Skip to content

Commit

Permalink
docs: update timers config description (jestjs#11376)
Browse files Browse the repository at this point in the history
  • Loading branch information
blimmer authored and mprinc committed May 9, 2021
1 parent af51f17 commit d816b95
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -109,6 +109,7 @@
- `[*]` [**BREAKING**] Remove deprecated `mapCoverage` ([#9968](https://github.com/facebook/jest/pull/9968))
- `[babel-jest]` [**BREAKING**] Migrate to ESM ([#11193](https://github.com/facebook/jest/pull/11193))
- `[docs]` Correct example using `browser-resolve` ([#11140](https://github.com/facebook/jest/pull/11140))
- `[docs]` Clarify `timers` configuration property ([#11376](https://github.com/facebook/jest/pull/11376))
- `[jest-config]` [**BREAKING**] Remove `enabledTestsMap` config, use `filter` instead ([#10787](https://github.com/facebook/jest/pull/10787))
- `[jest-console]` [**BREAKING**] Move `root` into `config` and take `GlobalConfig` as mandatory parameter for `getConsoleOutput` ([#10126](https://github.com/facebook/jest/pull/10126))
- `[jest-console]` Export LogEntry ([#11017](https://github.com/facebook/jest/pull/11017))
Expand Down
2 changes: 1 addition & 1 deletion docs/Configuration.md
Expand Up @@ -1296,7 +1296,7 @@ This option sets the URL for the jsdom environment. It is reflected in propertie

Default: `real`

Setting this value to `fake` or `modern` allows the use of fake timers for functions such as `setTimeout`. Fake timers are useful when a piece of code sets a long timeout that we don't want to wait for in a test.
Setting this value to `fake` or `modern` enables fake timers for all tests by default. Fake timers are useful when a piece of code sets a long timeout that we don't want to wait for in a test. You can learn more about fake timers [here](JestObjectAPI.md#jestusefaketimersimplementation-modern--legacy).

If the value is `legacy`, the old implementation will be used as implementation instead of one backed by [`@sinonjs/fake-timers`](https://github.com/sinonjs/fake-timers).

Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-25.x/Configuration.md
Expand Up @@ -1181,7 +1181,7 @@ This option sets the URL for the jsdom environment. It is reflected in propertie

Default: `real`

Setting this value to `legacy` or `fake` allows the use of fake timers for functions such as `setTimeout`. Fake timers are useful when a piece of code sets a long timeout that we don't want to wait for in a test.
Setting this value to `legacy` or `fake` enables fake timers for all tests by default. Fake timers are useful when a piece of code sets a long timeout that we don't want to wait for in a test. You can learn more about fake timers [here](JestObjectAPI.md#jestusefaketimers).

### `transform` \[object\<string, pathToTransformer | \[pathToTransformer, object]>]

Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-26.x/Configuration.md
Expand Up @@ -1271,7 +1271,7 @@ This option sets the URL for the jsdom environment. It is reflected in propertie

Default: `real`

Setting this value to `legacy` or `fake` allows the use of fake timers for functions such as `setTimeout`. Fake timers are useful when a piece of code sets a long timeout that we don't want to wait for in a test.
Setting this value to `legacy` or `modern` enables fake timers for all tests by default. Fake timers are useful when a piece of code sets a long timeout that we don't want to wait for in a test. You can learn more about fake timers [here](JestObjectAPI.md#jestusefaketimersimplementation-modern--legacy).

If the value is `modern`, [`@sinonjs/fake-timers`](https://github.com/sinonjs/fake-timers) will be used as implementation instead of Jest's own legacy implementation. This will be the default fake implementation in Jest 27.

Expand Down

0 comments on commit d816b95

Please sign in to comment.