-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c50c4d5
commit 5fd7c5a
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# fetch-mock | ||
|
||
Work in progress reimplememntation of 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/core requires either of the following to run: | ||
|
||
- [Node.js](https://nodejs.org/) 18+ for full feature operation | ||
- Any modern browser that supports the `fetch` API | ||
- [node-fetch](https://www.npmjs.com/package/node-fetch) when testing in earlier versions of Node.js (this is untested, but shoudl mostly work) | ||
|
||
## Documentation and Usage | ||
|
||
See the [project website](https://www.wheresrhys.co.uk/fetch-mock/docs/@fetch-mock/core/) | ||
|
||
## License | ||
|
||
@fetch-mock/core is licensed under the [MIT](https://github.com/wheresrhys/fetch-mock/blob/master/LICENSE) license. | ||
Copyright © 2024, Rhys Evans |