From 5de5484f0c33cdea7b4470b5ad36c2885c7868e9 Mon Sep 17 00:00:00 2001 From: Mike MacCana Date: Fri, 6 May 2022 11:30:53 +0100 Subject: [PATCH] Make it clearer that jest.setTimeout() is for the entire file (#12809) --- docs/JestObjectAPI.md | 4 +++- website/versioned_docs/version-25.x/JestObjectAPI.md | 4 +++- website/versioned_docs/version-26.x/JestObjectAPI.md | 4 +++- website/versioned_docs/version-27.x/JestObjectAPI.md | 4 +++- website/versioned_docs/version-28.0/JestObjectAPI.md | 4 +++- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/docs/JestObjectAPI.md b/docs/JestObjectAPI.md index 3b77e532ab35..9d3629f2a7a5 100644 --- a/docs/JestObjectAPI.md +++ b/docs/JestObjectAPI.md @@ -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._ diff --git a/website/versioned_docs/version-25.x/JestObjectAPI.md b/website/versioned_docs/version-25.x/JestObjectAPI.md index 3437f2f9d5f9..59e0eaa9068f 100644 --- a/website/versioned_docs/version-25.x/JestObjectAPI.md +++ b/website/versioned_docs/version-25.x/JestObjectAPI.md @@ -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._ diff --git a/website/versioned_docs/version-26.x/JestObjectAPI.md b/website/versioned_docs/version-26.x/JestObjectAPI.md index e2f4bdd0142a..c491301cbbd8 100644 --- a/website/versioned_docs/version-26.x/JestObjectAPI.md +++ b/website/versioned_docs/version-26.x/JestObjectAPI.md @@ -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._ diff --git a/website/versioned_docs/version-27.x/JestObjectAPI.md b/website/versioned_docs/version-27.x/JestObjectAPI.md index 2a72e44c0310..74dfb31bbed8 100644 --- a/website/versioned_docs/version-27.x/JestObjectAPI.md +++ b/website/versioned_docs/version-27.x/JestObjectAPI.md @@ -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._ diff --git a/website/versioned_docs/version-28.0/JestObjectAPI.md b/website/versioned_docs/version-28.0/JestObjectAPI.md index 3b77e532ab35..9d3629f2a7a5 100644 --- a/website/versioned_docs/version-28.0/JestObjectAPI.md +++ b/website/versioned_docs/version-28.0/JestObjectAPI.md @@ -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._