Skip to content

Commit

Permalink
tests: add tests reproducing testing-library#914
Browse files Browse the repository at this point in the history
  • Loading branch information
renatoalencar committed Mar 25, 2021
1 parent aa1309c commit 4580d71
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/__tests__/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,16 @@ describe('run with real timers', () => {
})
expect(global.setTimeout).toBe(fakedSetTimeout)
})

test('safe check for setImmediate and clearImmediate', () => {
const setImeediate = global.setImmediate
const clearImmediate = global.clearImmediate
delete global.setImmediate
delete global.clearImmediate

expect(() => runWithRealTimers(() => {})).not.toThrow()

global.setImmediate = setImeediate
global.clearImmediate = clearImmediate
})
})

0 comments on commit 4580d71

Please sign in to comment.