Skip to content

Commit

Permalink
Make it clearer that jest.setTimeout() is for the entire file (#12809)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemaccana committed May 6, 2022
1 parent 34d15d1 commit 5de5484
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
4 changes: 3 additions & 1 deletion docs/JestObjectAPI.md
Expand Up @@ -819,7 +819,9 @@ This function is not available when using legacy fake timers implementation.

### `jest.setTimeout(timeout)`

Set the default timeout interval for tests and before/after hooks in milliseconds. This only affects the test file from which this function is called.
Set the default timeout interval (in milliseconds) for all tests and before/after hooks in the test file. This only affects the test file from which this function is called.

To set timeout intervals on different tests in the same file, use the [`timeout` option on each individual test](GlobalAPI.md#testname-fn-timeout).

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

Expand Down
4 changes: 3 additions & 1 deletion website/versioned_docs/version-25.x/JestObjectAPI.md
Expand Up @@ -642,7 +642,9 @@ Returns the number of fake timers still left to run.

### `jest.setTimeout(timeout)`

Set the default timeout interval for tests and before/after hooks in milliseconds. This only affects the test file from which this function is called.
Set the default timeout interval (in milliseconds) for all tests and before/after hooks in the test file. This only affects the test file from which this function is called.

To set timeout intervals on different tests in the same file, use the [`timeout` option on each individual test](GlobalAPI.md#testname-fn-timeout).

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

Expand Down
4 changes: 3 additions & 1 deletion website/versioned_docs/version-26.x/JestObjectAPI.md
Expand Up @@ -662,7 +662,9 @@ When mocking time, `Date.now()` will also be mocked. If you for some reason need

### `jest.setTimeout(timeout)`

Set the default timeout interval for tests and before/after hooks in milliseconds. This only affects the test file from which this function is called.
Set the default timeout interval (in milliseconds) for all tests and before/after hooks in the test file. This only affects the test file from which this function is called.

To set timeout intervals on different tests in the same file, use the [`timeout` option on each individual test](GlobalAPI.md#testname-fn-timeout).

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

Expand Down
4 changes: 3 additions & 1 deletion website/versioned_docs/version-27.x/JestObjectAPI.md
Expand Up @@ -702,7 +702,9 @@ When mocking time, `Date.now()` will also be mocked. If you for some reason need

### `jest.setTimeout(timeout)`

Set the default timeout interval for tests and before/after hooks in milliseconds. This only affects the test file from which this function is called.
Set the default timeout interval (in milliseconds) for all tests and before/after hooks in the test file. This only affects the test file from which this function is called.

To set timeout intervals on different tests in the same file, use the [`timeout` option on each individual test](GlobalAPI.md#testname-fn-timeout).

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

Expand Down
4 changes: 3 additions & 1 deletion website/versioned_docs/version-28.0/JestObjectAPI.md
Expand Up @@ -819,7 +819,9 @@ This function is not available when using legacy fake timers implementation.

### `jest.setTimeout(timeout)`

Set the default timeout interval for tests and before/after hooks in milliseconds. This only affects the test file from which this function is called.
Set the default timeout interval (in milliseconds) for all tests and before/after hooks in the test file. This only affects the test file from which this function is called.

To set timeout intervals on different tests in the same file, use the [`timeout` option on each individual test](GlobalAPI.md#testname-fn-timeout).

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

Expand Down

0 comments on commit 5de5484

Please sign in to comment.