IE 8&9 use setTimeout to clearStack so mock clock gets tricky

This commit is contained in:
Gregg Van Hove
2017-06-20 10:29:19 -07:00
parent 585287b9d6
commit 6aa069d586
+25 -37
View File
@@ -915,48 +915,36 @@ describe("jasmine spec running", function () {
env.execute(); env.execute();
}); });
describe("When an async function times out", function() { it("skips to cleanup functions when an async function times out", function(done) {
beforeEach(function() { var actions = [];
jasmine.clock().install();
env = new jasmineUnderTest.Env();
});
afterEach(function() { env.describe('Something', function() {
jasmine.clock().uninstall(); env.beforeEach(function(innerDone) {
}); actions.push('beforeEach');
}, 1);
it("skips to cleanup functions", function(done) { env.afterEach(function() {
var actions = []; actions.push('afterEach');
env.describe('Something', function() {
env.beforeEach(function(done) {
actions.push('beforeEach');
});
env.afterEach(function() {
actions.push('afterEach');
});
env.it('does it' , function() {
actions.push('it');
});
}); });
env.throwOnExpectationFailure(true); env.it('does it' , function() {
actions.push('it');
var assertions = function() { });
expect(actions).toEqual([
'beforeEach',
'afterEach'
]);
done();
};
env.addReporter({jasmineDone: assertions});
env.execute();
jasmine.clock().tick(jasmineUnderTest.DEFAULT_TIMEOUT_INTERVAL);
}); });
env.throwOnExpectationFailure(true);
var assertions = function() {
expect(actions).toEqual([
'beforeEach',
'afterEach'
]);
done();
};
env.addReporter({jasmineDone: assertions});
env.execute();
}); });
}); });
}); });