From 7400207f0344534a5bf8828a510364fb83e92cbf Mon Sep 17 00:00:00 2001 From: BIKI DAS Date: Mon, 7 Feb 2022 22:06:21 +0530 Subject: [PATCH] docs: added info about modern and legacy timers (#12317) --- 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..8240867a71d1 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 included - `modern` and `legacy`, where `modern` is the default one. See [configuration](Configuration.md#timers-string) for how to configure it. + ## 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..3a53f6a49562 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 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 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..fe3c32535689 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 included - `modern` and `legacy`, where `modern` is the default one. See [configuration](Configuration.md#timers-string) for how to configure it. + ## 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..fe3c32535689 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 included - `modern` and `legacy`, where `modern` is the default one. See [configuration](Configuration.md#timers-string) for how to configure it. + ## 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..fe3c32535689 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 included - `modern` and `legacy`, where `modern` is the default one. See [configuration](Configuration.md#timers-string) for how to configure it. + ## 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..fe3c32535689 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 included - `modern` and `legacy`, where `modern` is the default one. See [configuration](Configuration.md#timers-string) for how to configure it. + ## 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..8240867a71d1 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 included - `modern` and `legacy`, where `modern` is the default one. See [configuration](Configuration.md#timers-string) for how to configure it. + ## 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: