-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: tests don't hang when there's an error in before() block. (#9527)
- Loading branch information
Showing
3 changed files
with
37 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
describe('should not hang when an error is thrown in a before() block', () => { | ||
before(() => { | ||
expect(true).to.be.false | ||
}) | ||
|
||
after(() => {}) | ||
it('has a test') | ||
it('has another test') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const helpers = require('../../support/helpers') | ||
|
||
const { createCypress } = helpers | ||
const { runIsolatedCypress } = createCypress() | ||
|
||
// https://github.com/cypress-io/cypress/issues/9162 | ||
describe('issue 9162', () => { | ||
beforeEach(function () { | ||
return runIsolatedCypress(`cypress/fixtures/issues/issue-9162.js`) | ||
}) | ||
|
||
it('tests does not hang even if there is a fail in before().', function () { | ||
cy.contains('expected true to be false') | ||
}) | ||
}) |
7289a45
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circle has built the
linux x64
version of the Test Runner.Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.
Run this command to install the pre-release locally:
7289a45
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circle has built the
darwin x64
version of the Test Runner.Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.
Run this command to install the pre-release locally: