Skip to content

Commit

Permalink
Create verification test for sinonjs#390
Browse files Browse the repository at this point in the history
  • Loading branch information
fatso83 committed Jun 18, 2021
1 parent cc30595 commit 836a37c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/fake-timers-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3955,6 +3955,24 @@ describe("FakeTimers", function () {
}
}, interval);
});

it("should not depend on having to stub setInterval or clearInterval to work", function (done) {
const origSetInterval = globalObject.setInterval;
const origClearInterval = globalObject.clearInterval;

var clock = FakeTimers.install({
shouldAdvanceTime: true,
toFake: ["setTimeout"],
});

assert.equals(globalObject.setInterval, origSetInterval);
assert.equals(globalObject.clearInterval, origClearInterval);

setTimeout(function () {
clock.uninstall();
done();
}, 0);
});
});

describe("requestAnimationFrame", function () {
Expand Down

0 comments on commit 836a37c

Please sign in to comment.