Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add setupFilesAfterEnv and jest.setTimeout example #8971

Merged
merged 5 commits into from Sep 22, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -49,6 +49,7 @@
- `[jest-environment-jsdom]` [**BREAKING**] Upgrade JSDOM from v11 to v15 ([#8851](https://github.com/facebook/jest/pull/8851))
- `[jest-util]` [**BREAKING**] Remove deprecated exports ([#8863](https://github.com/facebook/jest/pull/8863))
- `[jest-validate]` [**BREAKING**] Use ESM exports ([#8874](https://github.com/facebook/jest/pull/8874))
- `[docs]` setupFilesAfterEnv arr expansion and updated reference in JestObjectApi ([#8824](https://github.com/facebook/jest/pull/8971))

### Performance

Expand Down
14 changes: 14 additions & 0 deletions docs/Configuration.md
Expand Up @@ -754,6 +754,20 @@ For example, Jest ships with several plug-ins to `jasmine` that work by monkey-p

_Note: `setupTestFrameworkScriptFile` is deprecated in favor of `setupFilesAfterEnv`._

Example `setupFilesAfterEnv` array in a jest.config.js:

```js
module.exports = {
setupFilesAfterEnv: ['./jest.setup.js'],
}
```

Example `jest.setup.js` file
```js
jest.setTimeout(10000); // in milliseconds
```


### `snapshotResolver` [string]

Default: `undefined`
Expand Down
2 changes: 1 addition & 1 deletion docs/JestObjectAPI.md
Expand Up @@ -647,7 +647,7 @@ Set the default timeout interval for tests and before/after hooks in millisecond

_Note: The default timeout interval is 5 seconds if this method is not called._

_Note: The method must be called after the test framework is installed in the environment and before the test runs. A good place to do this is in the `setupTestFrameworkScriptFile`._
_Note: The method must be called after the test framework is installed in the environment and before the test runs. A good place to do this is in the `jest.config` with `setupFilesAfterEnv`._
jeysal marked this conversation as resolved.
Show resolved Hide resolved

Example:

Expand Down