Make sure the queue runner goes async for async specs
- Even if `done` is called synchronously.
See #1327 #1334 jasmine/gulp-jasmine-browser#48
This is a backport of 578f63b9bd
to 2.6.x.
This commit is contained in:
@@ -456,7 +456,7 @@ describe("Env integration", function() {
|
||||
env.execute();
|
||||
});
|
||||
|
||||
it("copes with late async failures", function(done) {
|
||||
it("copes with async failures after done has been called", function(done) {
|
||||
var global = {
|
||||
setTimeout: function(fn, delay) { setTimeout(fn, delay) },
|
||||
clearTimeout: function(fn, delay) { clearTimeout(fn, delay) },
|
||||
@@ -466,6 +466,7 @@ describe("Env integration", function() {
|
||||
reporter = jasmine.createSpyObj('fakeReporter', [ "specDone", "jasmineDone", "suiteDone" ]);
|
||||
|
||||
reporter.jasmineDone.and.callFake(function() {
|
||||
expect(reporter.specDone).not.toHaveFailedExpecationsForRunnable('A suite fails', ['fail thrown']);
|
||||
expect(reporter.suiteDone).toHaveFailedExpecationsForRunnable('A suite', ['fail thrown']);
|
||||
done();
|
||||
});
|
||||
@@ -474,9 +475,11 @@ describe("Env integration", function() {
|
||||
|
||||
env.fdescribe('A suite', function() {
|
||||
env.it('fails', function(specDone) {
|
||||
specDone();
|
||||
setTimeout(function() {
|
||||
global.onerror('fail');
|
||||
specDone();
|
||||
setTimeout(function() {
|
||||
global.onerror('fail');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user