diff --git a/README.md b/README.md index 882c2a7a0..d09b10f23 100644 --- a/README.md +++ b/README.md @@ -94,12 +94,13 @@ yarn add --dev @testing-library/jest-native npm install --save-dev @testing-library/jest-native ``` -Then automatically add it to your jest tests by using `setupFilesAfterEnv` option in the `jest.config.js` file: +Then automatically add it to your jest tests by using `setupFilesAfterEnv` option in your Jest configuration (it's usually located either in `package.json` under `"jest"` key or in a `jest.config.js` file): -```js -module.exports = { - setupFilesAfterEnv: ['@testing-library/jest-native/extend-expect'], -}; +```json +{ + "preset": "react-native", + "setupFilesAfterEnv": ["@testing-library/jest-native/extend-expect"] +} ``` ### Flow diff --git a/website/docs/GettingStarted.md b/website/docs/GettingStarted.md index ebe68f750..9ba8587b9 100644 --- a/website/docs/GettingStarted.md +++ b/website/docs/GettingStarted.md @@ -86,10 +86,11 @@ yarn add --dev @testing-library/jest-native npm install --save-dev @testing-library/jest-native ``` -Then automatically add it to your jest tests by using `setupFilesAfterEnv` option in the `jest.config.js` file: +Then automatically add it to your jest tests by using `setupFilesAfterEnv` option in your Jest configuration (it's usually located either in `package.json` under `"jest"` key or in a `jest.config.js` file): -```js -module.exports = { - setupFilesAfterEnv: ['@testing-library/jest-native/extend-expect'], -}; +```json +{ + "preset": "react-native", + "setupFilesAfterEnv": ["@testing-library/jest-native/extend-expect"] +} ```