Option "setupTestFrameworkScriptFile" was replaced by configuration "setupFilesAfterEnv", which supports multiple paths
Jest
used to have a config option called setupTestFrameworkScriptFile
...
...but it was deprecated in favor of the newer setupFilesAfterEnv
in PR #7119 which shipped with version 24.0.0.
Since you are using Jest
^v24.1.0 you will need to use setupFilesAfterEnv
.
Just find where setupTestFrameworkScriptFile
is used in your Jest
config, rename it to setupFilesAfterEnv
, and put the single file it used to point to in an array and you should be good to go.
Example, change this jest.config.js
:
module.exports = {
...
setupTestFrameworkScriptFile: './setup.js',
...
}
...to this:
module.exports = {
...
setupFilesAfterEnv: ['./setup.js'],
...
}
If you are using create-react-app, change the key name at package.json
file
from
"jest": {
// ...
"setupTestFrameworkScriptFile": "<rootDir>/src/setupTests.js",
to
"jest": {
// ...
"setupFilesAfterEnv": ["<rootDir>/src/setupTests.js"],