Add in missing clock uninstall

This commit is contained in:
Sheel Choksi
2013-10-29 17:28:41 -07:00
parent 40e3020fdc
commit 966f76b481

View File

@@ -36,6 +36,15 @@ describe("QueueRunner", function() {
expect(asyncContext).toBe(context); expect(asyncContext).toBe(context);
}); });
describe("with an asynchronous function", function() {
beforeEach(function() {
jasmine.clock().install();
});
afterEach(function() {
jasmine.clock().uninstall();
});
it("supports asynchronous functions, only advancing to next function after a done() callback", function() { it("supports asynchronous functions, only advancing to next function after a done() callback", function() {
//TODO: it would be nice if spy arity could match the fake, so we could do something like: //TODO: it would be nice if spy arity could match the fake, so we could do something like:
//createSpy('asyncfn').and.callFake(function(done) {}); //createSpy('asyncfn').and.callFake(function(done) {});
@@ -67,8 +76,6 @@ describe("QueueRunner", function() {
onComplete: onComplete onComplete: onComplete
}); });
jasmine.clock().install();
queueRunner.execute(); queueRunner.execute();
expect(beforeCallback).toHaveBeenCalled(); expect(beforeCallback).toHaveBeenCalled();
@@ -91,6 +98,7 @@ describe("QueueRunner", function() {
expect(onComplete).toHaveBeenCalled(); expect(onComplete).toHaveBeenCalled();
}); });
});
it("calls an exception handler when an exception is thrown in a fn", function() { it("calls an exception handler when an exception is thrown in a fn", function() {
var fn = function() { var fn = function() {