Test that show that afterEach and after are not being called when a waitsFor times out.
This commit is contained in:
@@ -399,6 +399,39 @@ describe("jasmine spec running", function () {
|
|||||||
expect(subsequentSpecRan).toEqual(true);
|
expect(subsequentSpecRan).toEqual(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("runs afterEach after timing out", function() {
|
||||||
|
var afterEach = jasmine.createSpy('afterEach');
|
||||||
|
|
||||||
|
env.describe('foo', function () {
|
||||||
|
env.afterEach(afterEach);
|
||||||
|
|
||||||
|
env.it('waitsFor', function () {
|
||||||
|
this.waitsFor(100, function() {
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}).execute();
|
||||||
|
|
||||||
|
fakeTimer.tick(500);
|
||||||
|
expect(afterEach).toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
|
it("runs single-spec after functions after timing out", function() {
|
||||||
|
var after = jasmine.createSpy('after');
|
||||||
|
|
||||||
|
env.describe('foo', function () {
|
||||||
|
env.it('waitsFor', function () {
|
||||||
|
this.after(after);
|
||||||
|
this.waitsFor(100, function() {
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}).execute();
|
||||||
|
|
||||||
|
fakeTimer.tick(500);
|
||||||
|
expect(after).toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
describe('with consecutive calls', function () {
|
describe('with consecutive calls', function () {
|
||||||
var foo;
|
var foo;
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user