Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

on(...) types do not match cy.stub() format #2007

Closed
bahmutov opened this issue Jun 21, 2018 · 1 comment · Fixed by #2008
Closed

on(...) types do not match cy.stub() format #2007

bahmutov opened this issue Jun 21, 2018 · 1 comment · Fixed by #2008
Assignees
Milestone

Comments

@bahmutov
Copy link
Contributor

bahmutov commented Jun 21, 2018

The TypeScript definition of Cypress.on and cy.on are not working correctly if you use cy.stub callback function. Example from Cypress window:alert documentation https://docs.cypress.io/api/events/catalog-of-events.html#Window-Alert

screen shot 2018-06-21 at 1 08 49 pm

Notice red line when I am using cy.stub() callback, this is because I am using //@ts-check in my specs. The types correctly work if I use "regular" callback function

Both Cypress.on and cy.on show red lines and show an error

cy on

Same for cy.on('window:confirm', cy.stub())

Cypress v3.0.1

@brian-mann
Copy link
Member

Released in 3.0.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants