Skip to content

Commit 30210c2

Browse files
Nathan Houlendhoule
authored andcommitted
Remove window.setTimeout,setInterval restoration (#53)
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.
1 parent 2bf9ee9 commit 30210c2

File tree

2 files changed

+0
-10
lines changed

2 files changed

+0
-10
lines changed

lib/protos.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ var noop = function noop() {};
3535

3636
var onerror = window.onerror;
3737
var onload = null;
38-
var setInterval = window.setInterval;
39-
var setTimeout = window.setTimeout;
4038

4139
/**
4240
* Mixin emitter.
@@ -234,8 +232,6 @@ exports.reset = function() {
234232
window[this.globals[i]] = undefined;
235233
}
236234

237-
window.setTimeout = setTimeout;
238-
window.setInterval = setInterval;
239235
window.onerror = onerror;
240236
window.onload = onload;
241237
};

test/index.test.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -619,18 +619,12 @@ describe('integration', function() {
619619
integration = new Integration();
620620

621621
var noop = function() {};
622-
var setTimeout = window.setTimeout;
623-
var setInterval = window.setInterval;
624622
var onerror = window.onerror;
625-
window.setTimeout = noop;
626-
window.setInterval = noop;
627623
window.onerror = noop;
628624
window.onload = noop;
629625

630626
integration.reset();
631627

632-
assert(window.setTimeout === setTimeout);
633-
assert(window.setInterval === setInterval);
634628
assert(window.onerror === onerror);
635629
assert(window.onload === onload);
636630
});

0 commit comments

Comments
 (0)