-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add Cypress v9 support * set up CI to test Cypress v9
- Loading branch information
Showing
8 changed files
with
3,278 additions
and
7 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
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,5 @@ | ||
{ | ||
"pluginsFile": false, | ||
"supportFile": false, | ||
"fixturesFolder": false | ||
} |
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,36 @@ | ||
/// <reference path="../../../src/index.d.ts" /> | ||
import '../../../src' | ||
|
||
it('executes the IF branch', () => { | ||
cy.wrap(1) | ||
.if('equal', 1) | ||
.then(cy.spy().as('if')) | ||
.else() | ||
.then(cy.spy().as('else')) | ||
.finally() | ||
.should('equal', 1) | ||
cy.get('@if').should('have.been.calledOnce') | ||
cy.get('@else').should('not.be.called') | ||
}) | ||
|
||
describe('wrapped value', () => { | ||
it('performs an action if the wrapped value is equal to 42', () => { | ||
cy.wrap(42).if('equal', 42).then(cy.spy().as('action')).then(cy.log) | ||
cy.get('@action').should('have.been.calledOnce') | ||
}) | ||
|
||
it('does nothing if it is not 42', () => { | ||
cy.wrap(1).if('equal', 42).then(cy.spy().as('action')).then(cy.log) | ||
cy.get('@action').should('not.have.been.called') | ||
}) | ||
|
||
context('.else', () => { | ||
it('passes the subject to the else branch', () => { | ||
cy.wrap(1).if('equal', 42).log('if branch').else().should('equal', 1) | ||
}) | ||
|
||
it('passes the subject if().else()', () => { | ||
cy.wrap(1).if('equal', 42).else().should('equal', 1) | ||
}) | ||
}) | ||
}) |
Oops, something went wrong.