Skip to content

Commit

Permalink
docs: readme for @fetch-mock/core
Browse files Browse the repository at this point in the history
  • Loading branch information
wheresrhys committed Aug 29, 2024
1 parent c50c4d5 commit 5fd7c5a
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions packages/core/README.md
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

0 comments on commit 5fd7c5a

Please sign in to comment.