Skip to content

Commit

Permalink
Merge pull request #196 from daniellenguyen/patch-2
Browse files Browse the repository at this point in the history
Add async to mockIf callback in README
  • Loading branch information
yinzara authored Mar 15, 2024
2 parents 800c40d + 61dc4fe commit 509478c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ To enable mocking for a specific URL only:
```js
beforeEach(() => {
// if you have an existing `beforeEach` just add the following lines to it
fetchMock.mockIf(/^https?:\/\/example.com.*$/, req => {
fetchMock.mockIf(/^https?:\/\/example.com.*$/, async (req) => {
if (req.url.endsWith('/path1')) {
return 'some response body'
} else if (req.url.endsWith('/path2')) {
Expand Down

0 comments on commit 509478c

Please sign in to comment.