From 15710937b8c2d9f1a892d49bfdf72af549cdb65e Mon Sep 17 00:00:00 2001 From: Steve Gravrock Date: Wed, 6 Oct 2021 11:05:55 -0700 Subject: [PATCH] Added a test that verifies skip to cleanup fns after pending() Because pending() is implemented via the standard exception handling path, we effectively got this feature for free as a result of the changes for #1533, particularly 457a2727. * [#178598493] * Fixes #1579 --- spec/core/integration/SpecRunningSpec.js | 33 ++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/spec/core/integration/SpecRunningSpec.js b/spec/core/integration/SpecRunningSpec.js index 5327df28..0f0a161a 100644 --- a/spec/core/integration/SpecRunningSpec.js +++ b/spec/core/integration/SpecRunningSpec.js @@ -904,6 +904,39 @@ describe('spec running', function() { expect(actions).toEqual(['beforeEach', 'afterEach']); }); + it('skips to cleanup functions after pending() is called', async function() { + const actions = []; + + env.describe('Something', function() { + env.beforeEach(function() { + actions.push('outer beforeEach'); + pending(); + }); + + env.afterEach(function() { + actions.push('outer afterEach'); + }); + + env.describe('Inner', function() { + env.beforeEach(function() { + actions.push('inner beforeEach'); + }); + + env.afterEach(function() { + actions.push('inner afterEach'); + }); + + env.it('does it', function() { + actions.push('inner it'); + }); + }); + }); + + await env.execute(); + + expect(actions).toEqual(['outer beforeEach', 'outer afterEach']); + }); + it('runs all reporter callbacks even if one fails', async function() { const laterReporter = jasmine.createSpyObj('laterReporter', ['specDone']);