Set fake timers after calling throttle
Calling throttle before setting the fake timers will break any implementations that save a timestamp outside the wrapper function.
This commit is contained in:
parent
0ef2dd3ae4
commit
393f1ce33d
1 changed files with 1 additions and 1 deletions
|
@ -7,8 +7,8 @@ describe("throttle(f, 1000)", function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
before(function() {
|
before(function() {
|
||||||
f1000 = throttle(f, 1000);
|
|
||||||
this.clock = sinon.useFakeTimers();
|
this.clock = sinon.useFakeTimers();
|
||||||
|
f1000 = throttle(f, 1000);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("the first call runs now", function() {
|
it("the first call runs now", function() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue