-
Notifications
You must be signed in to change notification settings - Fork 318
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6f9085e
commit ad0736a
Showing
6 changed files
with
278 additions
and
101 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,27 @@ | ||
/* eslint-disable */ | ||
describe('after', () => { | ||
after(() => { | ||
throw new Error('error in after hook') | ||
}) | ||
it('passes', () => { | ||
cy.visit('/') | ||
.get('.hello-world') | ||
.should('have.text', 'Hello World') | ||
}) | ||
it('will be marked as failed', () => { | ||
cy.visit('/') | ||
.get('.hello-world') | ||
.should('have.text', 'Hello World') | ||
}) | ||
}) | ||
|
||
describe('before', () => { | ||
before(() => { | ||
throw new Error('error in before hook') | ||
}) | ||
it('will be skipped', () => { | ||
cy.visit('/') | ||
.get('.hello-world') | ||
.should('have.text', 'Hello World') | ||
}) | ||
}) |
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,24 @@ | ||
/* eslint-disable */ | ||
let numTests = 0 | ||
describe('hook-test-error tests', () => { | ||
afterEach(() => { | ||
if (numTests++ >= 1) { | ||
throw new Error('error in after each hook') | ||
} | ||
}) | ||
it('passes', () => { | ||
cy.visit('/') | ||
.get('.hello-world') | ||
.should('have.text', 'Hello World') | ||
}) | ||
it('will fail because afterEach fails', () => { | ||
cy.visit('/') | ||
.get('.hello-world') | ||
.should('have.text', 'Hello World') | ||
}) | ||
it('does not run because earlier afterEach fails', () => { | ||
cy.visit('/') | ||
.get('.hello-world') | ||
.should('have.text', 'Hello World') | ||
}) | ||
}) |
Oops, something went wrong.