From a1829e9385bef6b007088a012bc3ceb0fa7867a8 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Mon, 18 Oct 2021 16:56:02 +0200 Subject: [PATCH] docs: fix setTimeout example (#11974) --- docs/TimerMocks.md | 1 + website/versioned_docs/version-27.0/TimerMocks.md | 1 + website/versioned_docs/version-27.1/TimerMocks.md | 1 + website/versioned_docs/version-27.2/TimerMocks.md | 1 + 4 files changed, 4 insertions(+) diff --git a/docs/TimerMocks.md b/docs/TimerMocks.md index ef2cc71fe361..e97e2af97709 100644 --- a/docs/TimerMocks.md +++ b/docs/TimerMocks.md @@ -25,6 +25,7 @@ module.exports = timerGame; 'use strict'; jest.useFakeTimers(); +jest.spyOn(global, 'setTimeout'); test('waits 1 second before ending the game', () => { const timerGame = require('../timerGame'); diff --git a/website/versioned_docs/version-27.0/TimerMocks.md b/website/versioned_docs/version-27.0/TimerMocks.md index ef2cc71fe361..e97e2af97709 100644 --- a/website/versioned_docs/version-27.0/TimerMocks.md +++ b/website/versioned_docs/version-27.0/TimerMocks.md @@ -25,6 +25,7 @@ module.exports = timerGame; 'use strict'; jest.useFakeTimers(); +jest.spyOn(global, 'setTimeout'); test('waits 1 second before ending the game', () => { const timerGame = require('../timerGame'); diff --git a/website/versioned_docs/version-27.1/TimerMocks.md b/website/versioned_docs/version-27.1/TimerMocks.md index ef2cc71fe361..e97e2af97709 100644 --- a/website/versioned_docs/version-27.1/TimerMocks.md +++ b/website/versioned_docs/version-27.1/TimerMocks.md @@ -25,6 +25,7 @@ module.exports = timerGame; 'use strict'; jest.useFakeTimers(); +jest.spyOn(global, 'setTimeout'); test('waits 1 second before ending the game', () => { const timerGame = require('../timerGame'); diff --git a/website/versioned_docs/version-27.2/TimerMocks.md b/website/versioned_docs/version-27.2/TimerMocks.md index ef2cc71fe361..e97e2af97709 100644 --- a/website/versioned_docs/version-27.2/TimerMocks.md +++ b/website/versioned_docs/version-27.2/TimerMocks.md @@ -25,6 +25,7 @@ module.exports = timerGame; 'use strict'; jest.useFakeTimers(); +jest.spyOn(global, 'setTimeout'); test('waits 1 second before ending the game', () => { const timerGame = require('../timerGame');