From 6aa069d586ce688bdeee8158e89101ddf4cb6705 Mon Sep 17 00:00:00 2001 From: Gregg Van Hove Date: Tue, 20 Jun 2017 10:29:19 -0700 Subject: [PATCH] IE 8&9 use `setTimeout` to `clearStack` so mock clock gets tricky --- spec/core/integration/SpecRunningSpec.js | 62 ++++++++++-------------- 1 file changed, 25 insertions(+), 37 deletions(-) diff --git a/spec/core/integration/SpecRunningSpec.js b/spec/core/integration/SpecRunningSpec.js index 9950f722..2028509a 100644 --- a/spec/core/integration/SpecRunningSpec.js +++ b/spec/core/integration/SpecRunningSpec.js @@ -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(); }); }); });