Skip to content

Commit

Permalink
Add instructions of setup Jest for jest-fetch-mock (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
jihchi committed Jun 11, 2020
1 parent d42200c commit eefa30c
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions README.md
Expand Up @@ -4,14 +4,31 @@
# Installation

**Prerequisite**: you have installed [jest-fetch-mock](https://github.com/jefflau/jest-fetch-mock#installation-and-setup).

```sh
npm install --save-dev bs-jest-fetch-mock
npm install --save-dev bs-jest-fetch-mock jest-fetch-mock

# or yarn...

yarn add -D bs-jest-fetch-mock jest-fetch-mock
```

# or ...
Add following code to your Jest's [setupFiles](https://jestjs.io/docs/en/configuration#setupfiles-array):

yarn add -D bs-jest-fetch-mock
```js
// jest.setup.js
require('jest-fetch-mock').enableMocks();
```

Add following code to your Jest's [configuration](https://jestjs.io/docs/en/configuration):

```js
// package.json
"jest": {
"automock": false,
"setupFiles": [
"./jest.setup.js"
]
}
```

# Usage
Expand Down

0 comments on commit eefa30c

Please sign in to comment.