From 5f56c8c70462c19032e68d9efbc9f2cb152db4a2 Mon Sep 17 00:00:00 2001 From: Biki-das Date: Mon, 7 Feb 2022 21:02:13 +0530 Subject: [PATCH 1/9] Added info about modern and leagcy timers --- docs/TimerMocks.md | 2 ++ website/versioned_docs/version-26.x/TimerMocks.md | 2 ++ website/versioned_docs/version-27.0/TimerMocks.md | 2 ++ website/versioned_docs/version-27.1/TimerMocks.md | 2 ++ website/versioned_docs/version-27.2/TimerMocks.md | 2 ++ website/versioned_docs/version-27.4/TimerMocks.md | 2 ++ website/versioned_docs/version-27.5/TimerMocks.md | 2 ++ 7 files changed, 14 insertions(+) diff --git a/docs/TimerMocks.md b/docs/TimerMocks.md index 29613b26dbff..332ff18a61b2 100644 --- a/docs/TimerMocks.md +++ b/docs/TimerMocks.md @@ -53,6 +53,8 @@ test('do something with real timers', () => { }); ``` +Currently, two implementations of the fake timers are present - `modern` and `legacy`, where `modern` is still the default one. You can read how to enable `modern` implementation [here](/blog/2020/05/05/jest-26#new-fake-timers). + ## Run All Timers Another test we might want to write for this module is one that asserts that the callback is called after 1 second. To do this, we're going to use Jest's timer control APIs to fast-forward time right in the middle of the test: diff --git a/website/versioned_docs/version-26.x/TimerMocks.md b/website/versioned_docs/version-26.x/TimerMocks.md index 8598c63c7e6c..b4b726b1bc80 100644 --- a/website/versioned_docs/version-26.x/TimerMocks.md +++ b/website/versioned_docs/version-26.x/TimerMocks.md @@ -37,6 +37,8 @@ Here we enable fake timers by calling `jest.useFakeTimers();`. This mocks out se All of the following functions need fake timers to be set, either by `jest.useFakeTimers()` or via `"timers": "fake"` in the config file. +Currently, two implementations of the fake timers are present - `modern` and `legacy`, where `modern` is still the default one. You can read how to enable `legacy` implementation [here](/blog/2020/05/05/jest-26#new-fake-timers). + ## Run All Timers Another test we might want to write for this module is one that asserts that the callback is called after 1 second. To do this, we're going to use Jest's timer control APIs to fast-forward time right in the middle of the test: diff --git a/website/versioned_docs/version-27.0/TimerMocks.md b/website/versioned_docs/version-27.0/TimerMocks.md index 44c210c4eebe..1229267e61b2 100644 --- a/website/versioned_docs/version-27.0/TimerMocks.md +++ b/website/versioned_docs/version-27.0/TimerMocks.md @@ -55,6 +55,8 @@ test('do something with real timers', () => { All of the following functions need fake timers to be set, either by `jest.useFakeTimers()` or via `"timers": "fake"` in the config file. +Currently, two implementations of the fake timers are present - `modern` and `legacy`, where `modern` is still the default one. You can read how to enable `modern` implementation [here](/blog/2020/05/05/jest-26#new-fake-timers). + ## Run All Timers Another test we might want to write for this module is one that asserts that the callback is called after 1 second. To do this, we're going to use Jest's timer control APIs to fast-forward time right in the middle of the test: diff --git a/website/versioned_docs/version-27.1/TimerMocks.md b/website/versioned_docs/version-27.1/TimerMocks.md index 44c210c4eebe..1229267e61b2 100644 --- a/website/versioned_docs/version-27.1/TimerMocks.md +++ b/website/versioned_docs/version-27.1/TimerMocks.md @@ -55,6 +55,8 @@ test('do something with real timers', () => { All of the following functions need fake timers to be set, either by `jest.useFakeTimers()` or via `"timers": "fake"` in the config file. +Currently, two implementations of the fake timers are present - `modern` and `legacy`, where `modern` is still the default one. You can read how to enable `modern` implementation [here](/blog/2020/05/05/jest-26#new-fake-timers). + ## Run All Timers Another test we might want to write for this module is one that asserts that the callback is called after 1 second. To do this, we're going to use Jest's timer control APIs to fast-forward time right in the middle of the test: diff --git a/website/versioned_docs/version-27.2/TimerMocks.md b/website/versioned_docs/version-27.2/TimerMocks.md index 44c210c4eebe..1229267e61b2 100644 --- a/website/versioned_docs/version-27.2/TimerMocks.md +++ b/website/versioned_docs/version-27.2/TimerMocks.md @@ -55,6 +55,8 @@ test('do something with real timers', () => { All of the following functions need fake timers to be set, either by `jest.useFakeTimers()` or via `"timers": "fake"` in the config file. +Currently, two implementations of the fake timers are present - `modern` and `legacy`, where `modern` is still the default one. You can read how to enable `modern` implementation [here](/blog/2020/05/05/jest-26#new-fake-timers). + ## Run All Timers Another test we might want to write for this module is one that asserts that the callback is called after 1 second. To do this, we're going to use Jest's timer control APIs to fast-forward time right in the middle of the test: diff --git a/website/versioned_docs/version-27.4/TimerMocks.md b/website/versioned_docs/version-27.4/TimerMocks.md index 44c210c4eebe..1229267e61b2 100644 --- a/website/versioned_docs/version-27.4/TimerMocks.md +++ b/website/versioned_docs/version-27.4/TimerMocks.md @@ -55,6 +55,8 @@ test('do something with real timers', () => { All of the following functions need fake timers to be set, either by `jest.useFakeTimers()` or via `"timers": "fake"` in the config file. +Currently, two implementations of the fake timers are present - `modern` and `legacy`, where `modern` is still the default one. You can read how to enable `modern` implementation [here](/blog/2020/05/05/jest-26#new-fake-timers). + ## Run All Timers Another test we might want to write for this module is one that asserts that the callback is called after 1 second. To do this, we're going to use Jest's timer control APIs to fast-forward time right in the middle of the test: diff --git a/website/versioned_docs/version-27.5/TimerMocks.md b/website/versioned_docs/version-27.5/TimerMocks.md index 29613b26dbff..332ff18a61b2 100644 --- a/website/versioned_docs/version-27.5/TimerMocks.md +++ b/website/versioned_docs/version-27.5/TimerMocks.md @@ -53,6 +53,8 @@ test('do something with real timers', () => { }); ``` +Currently, two implementations of the fake timers are present - `modern` and `legacy`, where `modern` is still the default one. You can read how to enable `modern` implementation [here](/blog/2020/05/05/jest-26#new-fake-timers). + ## Run All Timers Another test we might want to write for this module is one that asserts that the callback is called after 1 second. To do this, we're going to use Jest's timer control APIs to fast-forward time right in the middle of the test: From a9a518e572d0e8e4fc1a3fd2ed1f592cd0d91bd2 Mon Sep 17 00:00:00 2001 From: Biki-das Date: Mon, 7 Feb 2022 21:08:45 +0530 Subject: [PATCH 2/9] Legacy in 26 --- website/versioned_docs/version-26.x/TimerMocks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/versioned_docs/version-26.x/TimerMocks.md b/website/versioned_docs/version-26.x/TimerMocks.md index b4b726b1bc80..aff9a0941e34 100644 --- a/website/versioned_docs/version-26.x/TimerMocks.md +++ b/website/versioned_docs/version-26.x/TimerMocks.md @@ -37,7 +37,7 @@ Here we enable fake timers by calling `jest.useFakeTimers();`. This mocks out se All of the following functions need fake timers to be set, either by `jest.useFakeTimers()` or via `"timers": "fake"` in the config file. -Currently, two implementations of the fake timers are present - `modern` and `legacy`, where `modern` is still the default one. You can read how to enable `legacy` implementation [here](/blog/2020/05/05/jest-26#new-fake-timers). +Currently, two implementations of the fake timers are present - `modern` and `legacy`, where `legacy` is still the default one. You can read how to enable `legacy` implementation [here](/blog/2020/05/05/jest-26#new-fake-timers). ## Run All Timers From d99afde1975462d4e73699424548f5b2ca1d745e Mon Sep 17 00:00:00 2001 From: BIKI DAS Date: Mon, 7 Feb 2022 21:53:09 +0530 Subject: [PATCH 3/9] Update docs/TimerMocks.md Co-authored-by: Simen Bekkhus --- docs/TimerMocks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/TimerMocks.md b/docs/TimerMocks.md index 332ff18a61b2..8240867a71d1 100644 --- a/docs/TimerMocks.md +++ b/docs/TimerMocks.md @@ -53,7 +53,7 @@ test('do something with real timers', () => { }); ``` -Currently, two implementations of the fake timers are present - `modern` and `legacy`, where `modern` is still the default one. You can read how to enable `modern` implementation [here](/blog/2020/05/05/jest-26#new-fake-timers). +Currently, two implementations of the fake timers are included - `modern` and `legacy`, where `modern` is the default one. See [configuration](Configuration.md#timers-string) for how to configure it. ## Run All Timers From 721ccdbc7d6dc8624d09039334b2f7a8005b336e Mon Sep 17 00:00:00 2001 From: BIKI DAS Date: Mon, 7 Feb 2022 21:53:15 +0530 Subject: [PATCH 4/9] Update website/versioned_docs/version-27.0/TimerMocks.md Co-authored-by: Simen Bekkhus --- website/versioned_docs/version-27.0/TimerMocks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/versioned_docs/version-27.0/TimerMocks.md b/website/versioned_docs/version-27.0/TimerMocks.md index 1229267e61b2..fe3c32535689 100644 --- a/website/versioned_docs/version-27.0/TimerMocks.md +++ b/website/versioned_docs/version-27.0/TimerMocks.md @@ -55,7 +55,7 @@ test('do something with real timers', () => { All of the following functions need fake timers to be set, either by `jest.useFakeTimers()` or via `"timers": "fake"` in the config file. -Currently, two implementations of the fake timers are present - `modern` and `legacy`, where `modern` is still the default one. You can read how to enable `modern` implementation [here](/blog/2020/05/05/jest-26#new-fake-timers). +Currently, two implementations of the fake timers are included - `modern` and `legacy`, where `modern` is the default one. See [configuration](Configuration.md#timers-string) for how to configure it. ## Run All Timers From efc344ea685ece5f905255602356f08c3f0663f9 Mon Sep 17 00:00:00 2001 From: BIKI DAS Date: Mon, 7 Feb 2022 21:53:21 +0530 Subject: [PATCH 5/9] Update website/versioned_docs/version-26.x/TimerMocks.md Co-authored-by: Simen Bekkhus --- website/versioned_docs/version-26.x/TimerMocks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/versioned_docs/version-26.x/TimerMocks.md b/website/versioned_docs/version-26.x/TimerMocks.md index aff9a0941e34..3a53f6a49562 100644 --- a/website/versioned_docs/version-26.x/TimerMocks.md +++ b/website/versioned_docs/version-26.x/TimerMocks.md @@ -37,7 +37,7 @@ Here we enable fake timers by calling `jest.useFakeTimers();`. This mocks out se All of the following functions need fake timers to be set, either by `jest.useFakeTimers()` or via `"timers": "fake"` in the config file. -Currently, two implementations of the fake timers are present - `modern` and `legacy`, where `legacy` is still the default one. You can read how to enable `legacy` implementation [here](/blog/2020/05/05/jest-26#new-fake-timers). +Currently, two implementations of the fake timers are included - `modern` and `legacy`, where `legacy` is still the default one. See [configuration](Configuration.md#timers-string) for how to configure it. ## Run All Timers From c1f6ce180bb0e834d696d1649bdcd8a12abd0e86 Mon Sep 17 00:00:00 2001 From: BIKI DAS Date: Mon, 7 Feb 2022 21:53:28 +0530 Subject: [PATCH 6/9] Update website/versioned_docs/version-27.2/TimerMocks.md Co-authored-by: Simen Bekkhus --- website/versioned_docs/version-27.2/TimerMocks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/versioned_docs/version-27.2/TimerMocks.md b/website/versioned_docs/version-27.2/TimerMocks.md index 1229267e61b2..fe3c32535689 100644 --- a/website/versioned_docs/version-27.2/TimerMocks.md +++ b/website/versioned_docs/version-27.2/TimerMocks.md @@ -55,7 +55,7 @@ test('do something with real timers', () => { All of the following functions need fake timers to be set, either by `jest.useFakeTimers()` or via `"timers": "fake"` in the config file. -Currently, two implementations of the fake timers are present - `modern` and `legacy`, where `modern` is still the default one. You can read how to enable `modern` implementation [here](/blog/2020/05/05/jest-26#new-fake-timers). +Currently, two implementations of the fake timers are included - `modern` and `legacy`, where `modern` is the default one. See [configuration](Configuration.md#timers-string) for how to configure it. ## Run All Timers From 752e62b30dc5aae88d65c0e18f62225d75faee9a Mon Sep 17 00:00:00 2001 From: BIKI DAS Date: Mon, 7 Feb 2022 21:53:38 +0530 Subject: [PATCH 7/9] Update website/versioned_docs/version-27.1/TimerMocks.md Co-authored-by: Simen Bekkhus --- website/versioned_docs/version-27.1/TimerMocks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/versioned_docs/version-27.1/TimerMocks.md b/website/versioned_docs/version-27.1/TimerMocks.md index 1229267e61b2..fe3c32535689 100644 --- a/website/versioned_docs/version-27.1/TimerMocks.md +++ b/website/versioned_docs/version-27.1/TimerMocks.md @@ -55,7 +55,7 @@ test('do something with real timers', () => { All of the following functions need fake timers to be set, either by `jest.useFakeTimers()` or via `"timers": "fake"` in the config file. -Currently, two implementations of the fake timers are present - `modern` and `legacy`, where `modern` is still the default one. You can read how to enable `modern` implementation [here](/blog/2020/05/05/jest-26#new-fake-timers). +Currently, two implementations of the fake timers are included - `modern` and `legacy`, where `modern` is the default one. See [configuration](Configuration.md#timers-string) for how to configure it. ## Run All Timers From d5a91873df388ea3cf8d062f40621dd91087d100 Mon Sep 17 00:00:00 2001 From: BIKI DAS Date: Mon, 7 Feb 2022 21:53:44 +0530 Subject: [PATCH 8/9] Update website/versioned_docs/version-27.5/TimerMocks.md Co-authored-by: Simen Bekkhus --- website/versioned_docs/version-27.5/TimerMocks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/versioned_docs/version-27.5/TimerMocks.md b/website/versioned_docs/version-27.5/TimerMocks.md index 332ff18a61b2..8240867a71d1 100644 --- a/website/versioned_docs/version-27.5/TimerMocks.md +++ b/website/versioned_docs/version-27.5/TimerMocks.md @@ -53,7 +53,7 @@ test('do something with real timers', () => { }); ``` -Currently, two implementations of the fake timers are present - `modern` and `legacy`, where `modern` is still the default one. You can read how to enable `modern` implementation [here](/blog/2020/05/05/jest-26#new-fake-timers). +Currently, two implementations of the fake timers are included - `modern` and `legacy`, where `modern` is the default one. See [configuration](Configuration.md#timers-string) for how to configure it. ## Run All Timers From d4ff5c8454d14d616e9e2491da60cad17aa91af3 Mon Sep 17 00:00:00 2001 From: BIKI DAS Date: Mon, 7 Feb 2022 21:53:54 +0530 Subject: [PATCH 9/9] Update website/versioned_docs/version-27.4/TimerMocks.md Co-authored-by: Simen Bekkhus --- website/versioned_docs/version-27.4/TimerMocks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/versioned_docs/version-27.4/TimerMocks.md b/website/versioned_docs/version-27.4/TimerMocks.md index 1229267e61b2..fe3c32535689 100644 --- a/website/versioned_docs/version-27.4/TimerMocks.md +++ b/website/versioned_docs/version-27.4/TimerMocks.md @@ -55,7 +55,7 @@ test('do something with real timers', () => { All of the following functions need fake timers to be set, either by `jest.useFakeTimers()` or via `"timers": "fake"` in the config file. -Currently, two implementations of the fake timers are present - `modern` and `legacy`, where `modern` is still the default one. You can read how to enable `modern` implementation [here](/blog/2020/05/05/jest-26#new-fake-timers). +Currently, two implementations of the fake timers are included - `modern` and `legacy`, where `modern` is the default one. See [configuration](Configuration.md#timers-string) for how to configure it. ## Run All Timers