We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c6acb0a commit aa1309cCopy full SHA for aa1309c
src/helpers.js
@@ -16,14 +16,19 @@ function runWithRealTimers(callback) {
16
17
function runWithJestRealTimers(callback) {
18
const timerAPI = {
19
- clearImmediate,
20
clearInterval,
21
clearTimeout,
22
- setImmediate,
23
setInterval,
24
setTimeout,
25
}
26
+ if (typeof setImmediate === 'function') {
+ timerAPI.setImmediate = setImmediate
27
+ }
28
+ if (typeof clearImmediate === 'function') {
29
+ timerAPI.clearImmediate = clearImmediate
30
31
+
32
jest.useRealTimers()
33
34
const callbackReturnValue = callback()
0 commit comments