Skip to content

Commit 5de5484

Browse files
authored
Make it clearer that jest.setTimeout() is for the entire file (#12809)
1 parent 34d15d1 commit 5de5484

File tree

5 files changed

+15
-5
lines changed

5 files changed

+15
-5
lines changed

docs/JestObjectAPI.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,9 @@ This function is not available when using legacy fake timers implementation.
819819

820820
### `jest.setTimeout(timeout)`
821821

822-
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.
822+
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.
823+
824+
To set timeout intervals on different tests in the same file, use the [`timeout` option on each individual test](GlobalAPI.md#testname-fn-timeout).
823825

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

website/versioned_docs/version-25.x/JestObjectAPI.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,9 @@ Returns the number of fake timers still left to run.
642642

643643
### `jest.setTimeout(timeout)`
644644

645-
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.
645+
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.
646+
647+
To set timeout intervals on different tests in the same file, use the [`timeout` option on each individual test](GlobalAPI.md#testname-fn-timeout).
646648

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

website/versioned_docs/version-26.x/JestObjectAPI.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,9 @@ When mocking time, `Date.now()` will also be mocked. If you for some reason need
662662

663663
### `jest.setTimeout(timeout)`
664664

665-
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.
665+
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.
666+
667+
To set timeout intervals on different tests in the same file, use the [`timeout` option on each individual test](GlobalAPI.md#testname-fn-timeout).
666668

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

website/versioned_docs/version-27.x/JestObjectAPI.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,9 @@ When mocking time, `Date.now()` will also be mocked. If you for some reason need
702702

703703
### `jest.setTimeout(timeout)`
704704

705-
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.
705+
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.
706+
707+
To set timeout intervals on different tests in the same file, use the [`timeout` option on each individual test](GlobalAPI.md#testname-fn-timeout).
706708

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

website/versioned_docs/version-28.0/JestObjectAPI.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,9 @@ This function is not available when using legacy fake timers implementation.
819819

820820
### `jest.setTimeout(timeout)`
821821

822-
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.
822+
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.
823+
824+
To set timeout intervals on different tests in the same file, use the [`timeout` option on each individual test](GlobalAPI.md#testname-fn-timeout).
823825

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

0 commit comments

Comments
 (0)