From fff339fec554fa90cb104b32a59c95bb66cd71b9 Mon Sep 17 00:00:00 2001 From: Mike MacCana Date: Wed, 4 May 2022 17:28:41 +0100 Subject: [PATCH 1/4] Make it clearer that jest.setTimeout() is for the entire file --- website/versioned_docs/version-28.0/JestObjectAPI.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/website/versioned_docs/version-28.0/JestObjectAPI.md b/website/versioned_docs/version-28.0/JestObjectAPI.md index 3b77e532ab35..19dd712c1a6d 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](https://jestjs.io/docs/api#testname-fn-timeout). _Note: The default timeout interval is 5 seconds if this method is not called._ From 5a65f25861f7b340b5820ec34d7dfbaaed71ffbe Mon Sep 17 00:00:00 2001 From: Mike MacCana Date: Thu, 5 May 2022 14:34:18 +0100 Subject: [PATCH 2/4] Update website/versioned_docs/version-28.0/JestObjectAPI.md Co-authored-by: Simen Bekkhus --- website/versioned_docs/version-28.0/JestObjectAPI.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/versioned_docs/version-28.0/JestObjectAPI.md b/website/versioned_docs/version-28.0/JestObjectAPI.md index 19dd712c1a6d..56c460885b59 100644 --- a/website/versioned_docs/version-28.0/JestObjectAPI.md +++ b/website/versioned_docs/version-28.0/JestObjectAPI.md @@ -821,7 +821,7 @@ This function is not available when using legacy fake timers implementation. 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). +To set timeout intervals on different tests in the same file, use the [`timeout` option on each individual test](API.md#testname-fn-timeout). _Note: The default timeout interval is 5 seconds if this method is not called._ From bc88c3e7abc4800778b8e2abe01f79a27092d4a7 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Fri, 6 May 2022 12:27:04 +0200 Subject: [PATCH 3/4] versioned docs --- 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 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/docs/JestObjectAPI.md b/docs/JestObjectAPI.md index 3b77e532ab35..56c460885b59 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](API.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..f51272a3d5e0 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](API.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..35e8724c9676 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](API.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..bab1696e36b1 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](API.md#testname-fn-timeout). _Note: The default timeout interval is 5 seconds if this method is not called._ From 198aa73e2102638e0a650942554aa289d139a4fe Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Fri, 6 May 2022 12:30:09 +0200 Subject: [PATCH 4/4] correct link --- docs/JestObjectAPI.md | 2 +- website/versioned_docs/version-25.x/JestObjectAPI.md | 2 +- website/versioned_docs/version-26.x/JestObjectAPI.md | 2 +- website/versioned_docs/version-27.x/JestObjectAPI.md | 2 +- website/versioned_docs/version-28.0/JestObjectAPI.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/JestObjectAPI.md b/docs/JestObjectAPI.md index 56c460885b59..9d3629f2a7a5 100644 --- a/docs/JestObjectAPI.md +++ b/docs/JestObjectAPI.md @@ -821,7 +821,7 @@ This function is not available when using legacy fake timers implementation. 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](API.md#testname-fn-timeout). +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 f51272a3d5e0..59e0eaa9068f 100644 --- a/website/versioned_docs/version-25.x/JestObjectAPI.md +++ b/website/versioned_docs/version-25.x/JestObjectAPI.md @@ -644,7 +644,7 @@ Returns the number of fake timers still left to run. 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](API.md#testname-fn-timeout). +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 35e8724c9676..c491301cbbd8 100644 --- a/website/versioned_docs/version-26.x/JestObjectAPI.md +++ b/website/versioned_docs/version-26.x/JestObjectAPI.md @@ -664,7 +664,7 @@ When mocking time, `Date.now()` will also be mocked. If you for some reason need 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](API.md#testname-fn-timeout). +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 bab1696e36b1..74dfb31bbed8 100644 --- a/website/versioned_docs/version-27.x/JestObjectAPI.md +++ b/website/versioned_docs/version-27.x/JestObjectAPI.md @@ -704,7 +704,7 @@ When mocking time, `Date.now()` will also be mocked. If you for some reason need 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](API.md#testname-fn-timeout). +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 56c460885b59..9d3629f2a7a5 100644 --- a/website/versioned_docs/version-28.0/JestObjectAPI.md +++ b/website/versioned_docs/version-28.0/JestObjectAPI.md @@ -821,7 +821,7 @@ This function is not available when using legacy fake timers implementation. 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](API.md#testname-fn-timeout). +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._