QueueRunner continues running functions in async case

Continue running functions even if an async spec throws an
exception during the synchronous portion of the spec
This commit is contained in:
Sheel Choksi
2013-07-07 21:00:07 -07:00
parent 7f6b16ccf2
commit ec7d58fce0
3 changed files with 26 additions and 4 deletions

View File

@@ -102,6 +102,18 @@ describe("QueueRunner", function() {
expect(function() { queueRunner.execute(); }).toThrow();
});
it("continues running the functions even after an exception is thrown in an async spec", function() {
var fn = function(done) { throw new Error("error"); },
nextFn = jasmine.createSpy("nextFunction");
queueRunner = new j$.QueueRunner({
fns: [fn, nextFn]
});
queueRunner.execute();
expect(nextFn).toHaveBeenCalled();
});
it("calls a provided complete callback when done", function() {
var fn = jasmine.createSpy('fn'),
completeCallback = jasmine.createSpy('completeCallback'),