Skip to content

Commit

Permalink
Fix the cy.once typings (#4788)
Browse files Browse the repository at this point in the history
* Fix the cy.once typings

* C -> c


Co-authored-by: Zach Bloomquist <github@chary.us>
  • Loading branch information
2 people authored and brian-mann committed Jul 23, 2019
1 parent ffe75ca commit abc996e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cli/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,12 @@ declare namespace Cypress {
*/
on: Actions

/**
* These events come from Cypress as it issues commands and reacts to their state. These are all useful to listen to for debugging purposes.
* @see https://on.cypress.io/catalog-of-events#App-Events
*/
once: Actions

/**
* These events come from Cypress as it issues commands and reacts to their state. These are all useful to listen to for debugging purposes.
* @see https://on.cypress.io/catalog-of-events#App-Events
Expand Down Expand Up @@ -934,6 +940,12 @@ declare namespace Cypress {
*/
on: Actions

/**
* These events come from Cypress as it issues commands and reacts to their state. These are all useful to listen to for debugging purposes.
* @see https://on.cypress.io/catalog-of-events#App-Events
*/
once: Actions

/**
* These events come from Cypress as it issues commands and reacts to their state. These are all useful to listen to for debugging purposes.
* @see https://on.cypress.io/catalog-of-events#App-Events
Expand Down
12 changes: 12 additions & 0 deletions cli/types/tests/cypress-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,18 @@ namespace CypressOnTests {
})
}

namespace CypressOnceTests {
Cypress.once('uncaught:exception', (error, runnable) => {
error // $ExpectType Error
runnable // $ExpectType IRunnable
})

cy.once('uncaught:exception', (error, runnable) => {
error // $ExpectType Error
runnable // $ExpectType IRunnable
})
}

namespace CypressOffTests {
Cypress.off('uncaught:exception', (error, runnable) => {
error // $ExpectType Error
Expand Down

4 comments on commit abc996e

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on abc996e Jul 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AppVeyor has built the win32 x64 version of the Test Runner.

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

set CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/3.4.1/win32-x64/appveyor-develop-abc996ec7030802e0d2f9564af8d96487336d984-26189725/cypress.zip
npm install https://cdn.cypress.io/beta/binary/3.4.1/win32-x64/appveyor-develop-abc996ec7030802e0d2f9564af8d96487336d984-26189725/cypress.zip

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on abc996e Jul 23, 2019

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.

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

export CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/3.4.1/linux-x64/circle-develop-abc996ec7030802e0d2f9564af8d96487336d984-137717/cypress.zip
npm install https://cdn.cypress.io/beta/npm/3.4.1/circle-develop-abc996ec7030802e0d2f9564af8d96487336d984-137712/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on abc996e Jul 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AppVeyor has built the win32 ia32 version of the Test Runner.

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

set CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/3.4.1/win32-ia32/appveyor-develop-abc996ec7030802e0d2f9564af8d96487336d984-26189725/cypress.zip
npm install https://cdn.cypress.io/beta/binary/3.4.1/win32-ia32/appveyor-develop-abc996ec7030802e0d2f9564af8d96487336d984-26189725/cypress.zip

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on abc996e Jul 23, 2019

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.

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

export CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/3.4.1/darwin-x64/circle-develop-abc996ec7030802e0d2f9564af8d96487336d984-137698/cypress.zip
npm install https://cdn.cypress.io/beta/npm/3.4.1/circle-develop-abc996ec7030802e0d2f9564af8d96487336d984-137697/cypress.tgz

Please sign in to comment.