diff --git a/docs/TimerMocks.md b/docs/TimerMocks.md index 68c449847813..ef40cf373285 100644 --- a/docs/TimerMocks.md +++ b/docs/TimerMocks.md @@ -37,6 +37,8 @@ test('waits 1 second before ending the game', () => { Here we enable fake timers by calling `jest.useFakeTimers();`. This mocks out setTimeout and other timer functions with mock functions. If running multiple tests inside of one file or describe block, `jest.useFakeTimers();` can be called before each test manually or with a setup function such as `beforeEach`. Not doing so will result in the internal usage counter not being reset. +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 `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: