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

TypeScript: Incorrect subject type from returning a wrapped `undefined` from `.then` #1219

NicholasBoll opened this issue Jan 23, 2018 · 1 comment


Copy link

@NicholasBoll NicholasBoll commented Jan 23, 2018

It is valid to return a wrapped undefined. Example: cy.wrap(undefined) or Promise.resolve(undefined) or even cy.wrap(null).

In this case, the subject is a wrapped undefined instead of an unwrapped undefined.

  • Operating System: N/A
  • Cypress Version: 1.4.1
  • Browser Version: N/A

Is this a Feature or Bug?


Current behavior:

  .then(() => cy.wrap(undefined))
  .then((subject) => {
    subject // Cypress.Chainable<undefined>

Desired behavior:

  .then(() => cy.wrap(undefined))
  .then((subject) => {
    subject // undefined

How to reproduce:

See "Current behavior"

Test code:

See "Current behavior"

Additional Info (images, stack traces, etc)

PR is on the way

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

Successfully merging a pull request may close this issue.

3 participants