Skip to content

Commit 2e4594f

Browse files
authored
docs: clarify configuration to incluude preset react-native (#362)
1 parent 16677ad commit 2e4594f

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,13 @@ yarn add --dev @testing-library/jest-native
9494
npm install --save-dev @testing-library/jest-native
9595
```
9696

97-
Then automatically add it to your jest tests by using `setupFilesAfterEnv` option in the `jest.config.js` file:
97+
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):
9898

99-
```js
100-
module.exports = {
101-
setupFilesAfterEnv: ['@testing-library/jest-native/extend-expect'],
102-
};
99+
```json
100+
{
101+
"preset": "react-native",
102+
"setupFilesAfterEnv": ["@testing-library/jest-native/extend-expect"]
103+
}
103104
```
104105

105106
### Flow

website/docs/GettingStarted.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,11 @@ yarn add --dev @testing-library/jest-native
8686
npm install --save-dev @testing-library/jest-native
8787
```
8888

89-
Then automatically add it to your jest tests by using `setupFilesAfterEnv` option in the `jest.config.js` file:
89+
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):
9090

91-
```js
92-
module.exports = {
93-
setupFilesAfterEnv: ['@testing-library/jest-native/extend-expect'],
94-
};
91+
```json
92+
{
93+
"preset": "react-native",
94+
"setupFilesAfterEnv": ["@testing-library/jest-native/extend-expect"]
95+
}
9596
```

0 commit comments

Comments
 (0)