Skip to content

Commit

Permalink
[Docs] jest: Update deprecated jest config key
Browse files Browse the repository at this point in the history
See #2013; #2015.
  • Loading branch information
VGoose authored and ljharb committed Feb 25, 2019
1 parent 6b3274b commit 1f17805
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/guides/react-native.md
Expand Up @@ -52,22 +52,22 @@ expect(wrapper.findWhere(node => node.prop('testID') === 'todo-item')).toExist()
## Example configuration for Jest

To perform the necessary configuration in your testing framework, it is recommended to use a setup script,
such as with Jest's `setupTestFrameworkScriptFile` setting.
such as with Jest's `setupFilesAfterEnv` setting.

Create or update a `jest.config.js` file at the root of your project to include the `setupTestFrameworkScriptFile` setting:
Create or update a `jest.config.js` file at the root of your project to include the `setupFilesAfterEnv` setting:

```jsx
// jest.config.js

module.exports = {
// Load setup-tests.js before test execution
setupTestFrameworkScriptFile: '<rootDir>setup-tests.js',
setupFilesAfterEnv: '<rootDir>setup-tests.js',

// ...
};
```

Then create or update the file specified in `setupTestFrameworkScriptFile`, in this case `setup-tests.js` in the project root:
Then create or update the file specified in `setupFilesAfterEnv`, in this case `setup-tests.js` in the project root:

```jsx
// setup-tests.js
Expand Down

0 comments on commit 1f17805

Please sign in to comment.