fetch-mock

Mock http requests made using fetch

fetch-mock downloads fetch-mock version fetch-mock license

fetch-mock유사 패키지:
npm 다운로드 트렌드
3 년
🌟 fetch-mock의 README.md에 실시간 사용 차트를 표시하려면 아래 코드를 복사하세요.
## Usage Trend
[![Usage Trend of fetch-mock](https://npm-compare.com/img/npm-trend/THREE_YEARS/fetch-mock.png)](https://npm-compare.com/fetch-mock#timeRange=THREE_YEARS)
Cumulative GitHub Star Trend
🌟 fetch-mock의 README.md에 GitHub Stars 트렌드 차트를 표시하려면 아래 코드를 복사하세요.
## GitHub Stars Trend
[![GitHub Stars Trend of fetch-mock](https://npm-compare.com/img/github-trend/fetch-mock.png)](https://npm-compare.com/fetch-mock)
통계 세부사항
패키지
다운로드
Stars
크기
Issues
발행일
라이선스
fetch-mock991,8121,310157 kB36日前MIT
fetch-mock의 README

fetch-mock

Features include:

  • mocks most of the fetch API spec, even advanced behaviours such as streaming and aborting
  • declarative matching for most aspects of a http request, including url, headers, body and query parameters
  • shorthands for the most commonly used features, such as matching a http method or matching one fetch only
  • support for delaying responses, or using your own async functions to define custom race conditions
  • can be used as a spy to observe real network requests
  • can be extended with your own reusable custom matchers that can be used both for matching fetch-calls and inspecting the results
  • isomorphic, and supports either a global fetch instance or a locally required instance

Requirements

@fetch-mock requires either of the following to run:

  • Node.js 18+ for full feature operation
  • Any modern browser that supports the fetch API
  • node-fetch when testing in earlier versions of Node.js (this is untested, but should mostly work)

Documentation and Usage

See the project website

License

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