Skip to content

Commit 93a5dd9

Browse files
Update docs to use setupFilesAfterEnv
1 parent 124db14 commit 93a5dd9

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

README.md

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -123,29 +123,21 @@ yarn add -D jest-extended
123123

124124
## Setup
125125

126-
Add jest-extended to your Jest setupTestFrameworkScriptFile configuration. [See for help](http://facebook.github.io/jest/docs/en/configuration.html#setuptestframeworkscriptfile-string)
126+
Add jest-extended to your Jest `setupFilesAfterEnv` configuration. [See for help](https://jestjs.io/docs/en/configuration.html#setupfilesafterenv-array)
127127

128128
``` json
129129
"jest": {
130-
"setupTestFrameworkScriptFile": "jest-extended"
130+
"setupFilesAfterEnv": ["jest-extended"]
131131
}
132132
```
133133

134-
If you are already using another test framework, like [jest-chain](https://github.com/mattphillips/jest-chain), then you should create a test setup file and `require` each of the frameworks you are using.
135-
134+
If you are already using another test framework, like [jest-chain](https://github.com/mattphillips/jest-chain), you just need to append `jest-extended` to the array of setup files
136135
For example:
137136

138-
```js
139-
// ./testSetup.js
140-
require('jest-extended');
141-
require('any other test framework libraries you are using');
142-
```
143-
144137
Then in your Jest config:
145-
146138
```json
147139
"jest": {
148-
"setupTestFrameworkScriptFile": "./testSetup.js"
140+
"setupFilesAfterEnv": ["jest-chain", "any-other-framework", "jest-extended"]
149141
}
150142
```
151143

0 commit comments

Comments
 (0)