@4c/fetch-mock 中文文档教程

发布于 4年前 浏览 26 项目主页 更新于 3年前

fetch-mock

使用 fetch

节点版本 licencenpm 下载 CircleCI代码覆盖率已知漏洞

fetchMock.mock('http://example.com', 200);
const res = await fetch('http://example.com');
assert(res.ok);
fetchMock.restore();

Table of Contents

我花了大量时间免费维护 fetch-mock。 我不要求付款,但正在为难民慈善机构筹款 - 请考虑捐款


Requirements

fetch-mock 需要以下内容才能运行:

  • Node.js 8+ for full feature operation
  • Node.js 0.12+ with limitations
  • npm (normally comes with Node.js)
  • Either of the following
  • node-fetch when testing in a nodejs
  • A browser that supports the fetch API when testing in a browser

Documentation and Usage

请参阅 项目网站

License

fetch-mock 已根据 MIT 许可证。 版权所有 © 2019,Rhys Evans

Housekeeping

npm version 可维护性

fetch-mock

Mock http requests made using fetch

node version licencenpm downloads CircleCICode coverageKnown Vulnerabilities

fetchMock.mock('http://example.com', 200);
const res = await fetch('http://example.com');
assert(res.ok);
fetchMock.restore();

Table of Contents

I devote a lot of time to maintaining fetch-mock for free. I don't ask for payment, but am raising money for a refugee charity - please consider donating


Requirements

fetch-mock requires the following to run:

  • Node.js 8+ for full feature operation
  • Node.js 0.12+ with limitations
  • npm (normally comes with Node.js)
  • Either of the following
  • node-fetch when testing in a nodejs
  • A browser that supports the fetch API when testing in a browser

Documentation and Usage

See the project website

License

fetch-mock is licensed under the MIT license. Copyright © 2019, Rhys Evans

Housekeeping

npm version maintainability

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文