diff --git a/src/helpers.js b/src/helpers.js index 1640892a..d12e5e85 100644 --- a/src/helpers.js +++ b/src/helpers.js @@ -5,7 +5,9 @@ const globalObj = typeof window === 'undefined' ? global : window // Currently this fn only supports jest timers, but it could support other test runners in the future. function runWithRealTimers(callback) { const usingJestFakeTimers = - globalObj.setTimeout._isMockFunction && typeof jest !== 'undefined' + globalObj.setTimeout && + globalObj.setTimeout._isMockFunction && + typeof jest !== 'undefined' if (usingJestFakeTimers) { jest.useRealTimers()