From 3994cc3577e4c983d024da1c9b49673eeae0ff31 Mon Sep 17 00:00:00 2001 From: Nathan Houle Date: Mon, 13 Jun 2016 20:10:40 -0700 Subject: [PATCH] Remove window.setTimeout,setInterval restoration I'm not entirely sure why we ever added this, but clear-globals does it anyway. Right now it's interfering with timer/clock mocking. --- lib/protos.js | 4 ---- test/index.test.js | 6 ------ 2 files changed, 10 deletions(-) diff --git a/lib/protos.js b/lib/protos.js index 9a2413b..2fdd5b4 100644 --- a/lib/protos.js +++ b/lib/protos.js @@ -35,8 +35,6 @@ var noop = function noop() {}; var onerror = window.onerror; var onload = null; -var setInterval = window.setInterval; -var setTimeout = window.setTimeout; /** * Mixin emitter. @@ -234,8 +232,6 @@ exports.reset = function() { window[this.globals[i]] = undefined; } - window.setTimeout = setTimeout; - window.setInterval = setInterval; window.onerror = onerror; window.onload = onload; }; diff --git a/test/index.test.js b/test/index.test.js index a41bed9..e19fefc 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -547,18 +547,12 @@ describe('integration', function() { integration = new Integration(); var noop = function() {}; - var setTimeout = window.setTimeout; - var setInterval = window.setInterval; var onerror = window.onerror; - window.setTimeout = noop; - window.setInterval = noop; window.onerror = noop; window.onload = noop; integration.reset(); - assert(window.setTimeout === setTimeout); - assert(window.setInterval === setInterval); assert(window.onerror === onerror); assert(window.onload === onload); });