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 all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
- `[*]` [**BREAKING**] Upgrade to Micromatch v4 ([#8852](https://github.com/facebook/jest/pull/8852))
- `[babel-plugin-jest-hoist]` [**BREAKING**] Use ESM exports ([#8874](https://github.com/facebook/jest/pull/8874))
- `[docs]` Fix broken link pointing to legacy JS file in "Snapshot Testing".
- `[docs]` Add `setupFilesAfterEnv` and `jest.setTimeout` example ([#8971](https://github.com/facebook/jest/pull/8971))
- `[jest]` [**BREAKING**] Use ESM exports ([#8874](https://github.com/facebook/jest/pull/8874))
- `[jest-cli]` [**BREAKING**] Use ESM exports ([#8874](https://github.com/facebook/jest/pull/8874))
- `[jest-cli]` [**BREAKING**] Remove re-exports from `@jest/core` ([#8874](https://github.com/facebook/jest/pull/8874))
Expand Down
13 changes: 13 additions & 0 deletions docs/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,19 @@ 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
Original file line number Diff line number Diff line change
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: If you want to set the timeout for all test files, a good place to do this is in `setupFilesAfterEnv`._

Example:

Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-22.x/JestObjectAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,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: If you want to set the timeout for all test files, a good place to do this is in `setupFilesAfterEnv`._

Example:

Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-23.x/JestObjectAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,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: If you want to set the timeout for all test files, a good place to do this is in `setupFilesAfterEnv`._

Example:

Expand Down
13 changes: 13 additions & 0 deletions website/versioned_docs/version-24.0/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,19 @@ 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 website/versioned_docs/version-24.0/JestObjectAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,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: If you want to set the timeout for all test files, a good place to do this is in `setupFilesAfterEnv`._

Example:

Expand Down
13 changes: 13 additions & 0 deletions website/versioned_docs/version-24.1/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,19 @@ 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
13 changes: 13 additions & 0 deletions website/versioned_docs/version-24.6/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,19 @@ 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
13 changes: 13 additions & 0 deletions website/versioned_docs/version-24.8/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,19 @@ 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
13 changes: 13 additions & 0 deletions website/versioned_docs/version-24.9/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,19 @@ 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 website/versioned_docs/version-24.9/JestObjectAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,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: If you want to set the timeout for all test files, a good place to do this is in `setupFilesAfterEnv`._

Example:

Expand Down