function getGlobalThis() { | |
return global || globalThis || self || window; | |
} | |
export function disableReactActEnv() { | |
let prev: boolean; | |
beforeEach(() => { | |
prev = getGlobalThis().IS_REACT_ACT_ENVIRONMENT; | |
getGlobalThis().IS_REACT_ACT_ENVIRONMENT = false; | |
}); | |
afterEach(() => { | |
getGlobalThis().IS_REACT_ACT_ENVIRONMENT = prev; | |
}); | |
} | |
export function enableReactActEnv() { | |
let prev: boolean; | |
beforeEach(() => { | |
prev = getGlobalThis().IS_REACT_ACT_ENVIRONMENT; | |
getGlobalThis().IS_REACT_ACT_ENVIRONMENT = true; | |
}); | |
afterEach(() => { | |
getGlobalThis().IS_REACT_ACT_ENVIRONMENT = prev; | |
}); | |
} |