Skip to content

Commit 92f2fba

Browse files
committed
Add missing cleanup to a test
1 parent c7a2352 commit 92f2fba

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

test/unit/queue.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,15 @@ describe('FlushQueue', function () {
8080

8181
it('can invoke events after a delay', function () {
8282
var clock = sinon.useFakeTimers();
83-
queue.push(spy);
84-
queue.flush(100);
85-
expect(spy.called).to.equal(false);
86-
clock.tick(100);
87-
expect(spy.called).to.equal(true);
83+
try {
84+
queue.push(spy);
85+
queue.flush(100);
86+
expect(spy.called).to.equal(false);
87+
clock.tick(100);
88+
expect(spy.called).to.equal(true);
89+
} finally {
90+
clock.restore();
91+
}
8892
});
8993

9094
});

0 commit comments

Comments
 (0)