Skip to content

Commit

Permalink
simplify test
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Sep 17, 2018
1 parent 4983ee8 commit ee3862e
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions test/lolex-test.js
Expand Up @@ -1225,21 +1225,17 @@ describe("lolex", function () {
it("should support clocks with start time", function () {
var startingPoint = new Date("2018-01-01").getTime();
this.clock = lolex.createClock(startingPoint);
var runOrder = [];
var that = this;
var invocations = 0;

this.clock.setTimeout(function cb() {
runOrder.push("mock1");
that.clock.setTimeout(cb, 49);
invocations++;
that.clock.setTimeout(cb, 50);
}, 50);

this.clock.setTimeout(function cb() {
runOrder.push("mock2");
}, 100);

this.clock.runToLast();

assert.equals(runOrder, ["mock1", "mock1", "mock2"]);
assert.equals(invocations, 1);
});

});
Expand Down

0 comments on commit ee3862e

Please sign in to comment.