diff --git a/spec/core/QueueRunnerSpec.js b/spec/core/QueueRunnerSpec.js index e81b811f..781aee5f 100644 --- a/spec/core/QueueRunnerSpec.js +++ b/spec/core/QueueRunnerSpec.js @@ -220,6 +220,20 @@ describe("QueueRunner", function() { jasmine.clock().tick(1); expect(nextQueueableFn.fn.calls.count()).toEqual(1); }); + + it("should return a null when you call done", function () { + // Some promises want handlers to return anything but undefined to help catch "forgotten returns". + var doneReturn, + queueableFn = { fn: function(done) { + doneReturn = done(); + } }, + queueRunner = new jasmineUnderTest.QueueRunner({ + queueableFns: [queueableFn] + }); + + queueRunner.execute(); + expect(doneReturn).toBe(null); + }); }); it("calls exception handlers when an exception is thrown in a fn", function() { diff --git a/src/core/QueueRunner.js b/src/core/QueueRunner.js index 3196e15b..94e647de 100644 --- a/src/core/QueueRunner.js +++ b/src/core/QueueRunner.js @@ -7,6 +7,7 @@ getJasmineRequireObj().QueueRunner = function(j$) { called = true; fn(); } + return null; }; }