Skip to content

Commit

Permalink
fix: resolve setImmediate issue when using with Cypress. (#316)
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanVann authored and Kent C. Dodds committed Jul 12, 2019
1 parent dae25d5 commit f5b84e3
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/helpers.js
Expand Up @@ -9,11 +9,9 @@ function setImmediatePolyfill(fn) {
}

// istanbul ignore next
const {
setTimeout,
clearTimeout,
setImmediate = setImmediatePolyfill,
} = globalObj
const clearTimeoutFn = globalObj.clearTimeout
const setImmediateFn = globalObj.setImmediate || setImmediatePolyfill
const setTimeoutFn = globalObj.setTimeout

function newMutationObserver(onMutation) {
const MutationObserverConstructor =
Expand All @@ -36,7 +34,7 @@ function getDocument() {
export {
getDocument,
newMutationObserver,
setImmediate,
setTimeout,
clearTimeout,
clearTimeoutFn as clearTimeout,
setImmediateFn as setImmediate,
setTimeoutFn as setTimeout,
}

0 comments on commit f5b84e3

Please sign in to comment.