Fix the cy.once typings (#4788)

* Fix the cy.once typings

* C -> c


Co-authored-by: Zach Bloomquist <github@chary.us>
This commit is contained in:
Stefano Magni
2019-07-23 20:37:59 +02:00
committed by Brian Mann
parent ffe75caa80
commit abc996ec70
2 changed files with 24 additions and 0 deletions
+12
View File
@@ -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
@@ -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
+12
View File
@@ -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