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

Make it clearer that jest.setTimeout() is for the entire file #12809

Merged
merged 5 commits into from
May 6, 2022
Merged
Changes from 1 commit
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
4 changes: 3 additions & 1 deletion website/versioned_docs/version-28.0/JestObjectAPI.md
Original file line number Diff line number Diff line change
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](https://jestjs.io/docs/api#testname-fn-timeout).
mikemaccana marked this conversation as resolved.
Show resolved Hide resolved

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

Expand Down