Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down