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

View File

@@ -915,48 +915,36 @@ describe("jasmine spec running", function () {
env.execute();
});
describe("When an async function times out", function() {
beforeEach(function() {
jasmine.clock().install();
env = new jasmineUnderTest.Env();
});
it("skips to cleanup functions when an async function times out", function(done) {
var actions = [];
afterEach(function() {
jasmine.clock().uninstall();
});
env.describe('Something', function() {
env.beforeEach(function(innerDone) {
actions.push('beforeEach');
}, 1);
it("skips to cleanup functions", function(done) {
var actions = [];
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.afterEach(function() {
actions.push('afterEach');
});
env.throwOnExpectationFailure(true);
var assertions = function() {
expect(actions).toEqual([
'beforeEach',
'afterEach'
]);
done();
};
env.addReporter({jasmineDone: assertions});
env.execute();
jasmine.clock().tick(jasmineUnderTest.DEFAULT_TIMEOUT_INTERVAL);
env.it('does it' , function() {
actions.push('it');
});
});
env.throwOnExpectationFailure(true);
var assertions = function() {
expect(actions).toEqual([
'beforeEach',
'afterEach'
]);
done();
};
env.addReporter({jasmineDone: assertions});
env.execute();
});
});
});