Skip to content
Permalink
Browse files
fix: resolve setImmediate issue when using with Cypress. (#316)
  • Loading branch information
DylanVann authored and kentcdodds committed Jul 12, 2019
1 parent dae25d5 commit f5b84e366fcc58a50430a5cb0ee82f9b43a3b4ad
Showing 1 changed file with 6 additions and 8 deletions.
@@ -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 =
@@ -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.