Skip to content

Commit a1829e9

Browse files
authored
docs: fix setTimeout example (#11974)
1 parent e7edb75 commit a1829e9

4 files changed

Lines changed: 4 additions & 0 deletions

File tree

docs/TimerMocks.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ module.exports = timerGame;
2525
'use strict';
2626

2727
jest.useFakeTimers();
28+
jest.spyOn(global, 'setTimeout');
2829

2930
test('waits 1 second before ending the game', () => {
3031
const timerGame = require('../timerGame');

website/versioned_docs/version-27.0/TimerMocks.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ module.exports = timerGame;
2525
'use strict';
2626

2727
jest.useFakeTimers();
28+
jest.spyOn(global, 'setTimeout');
2829

2930
test('waits 1 second before ending the game', () => {
3031
const timerGame = require('../timerGame');

website/versioned_docs/version-27.1/TimerMocks.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ module.exports = timerGame;
2525
'use strict';
2626

2727
jest.useFakeTimers();
28+
jest.spyOn(global, 'setTimeout');
2829

2930
test('waits 1 second before ending the game', () => {
3031
const timerGame = require('../timerGame');

website/versioned_docs/version-27.2/TimerMocks.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ module.exports = timerGame;
2525
'use strict';
2626

2727
jest.useFakeTimers();
28+
jest.spyOn(global, 'setTimeout');
2829

2930
test('waits 1 second before ending the game', () => {
3031
const timerGame = require('../timerGame');

0 commit comments

Comments
 (0)