Skip to content

Commit

Permalink
Document ponyfill mock
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanrhee authored Jan 26, 2022
1 parent 79e79e8 commit 7ce13a4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,16 @@ If you are using [Create-React-App](https://github.com/facebookincubator/create-
}
```

### Usage with cross-mock ponyfills

If you are using the [`cross-fetch`](https://github.com/lquixada/cross-fetch) [ponyfill](https://github.com/sindresorhus/ponyfill), set the jest mock directly rather than `enableFetchMock()`. Add the following lines to the start of your test case (before any other imports):

``typescript
//
import fetchMock from "jest-fetch-mock";
jest.setMock("cross-fetch", fetchMock);
```
## API
### Mock Responses
Expand Down

0 comments on commit 7ce13a4

Please sign in to comment.