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

allow .its to yield undefined #3226

Merged
merged 4 commits into from
Mar 15, 2019
Merged

allow .its to yield undefined #3226

merged 4 commits into from
Mar 15, 2019

Conversation

kuceb
Copy link
Contributor

@kuceb kuceb commented Jan 25, 2019

fix #1531 allow .its to yield undefined
fix #3241 undefined does not retry

yes, this is a breaking change. But I think it makes a lot of sense
maybe this is not a breaking change, since this makes test code fail less.

  • add tests
  • test case for getter throwing
    remove else clause that won't get hit
  • allow cypress to retry undefined subject / test

@kuceb kuceb requested a review from brian-mann January 25, 2019 19:27
@kuceb kuceb requested review from brian-mann and removed request for brian-mann January 29, 2019 19:18
@brian-mann
Copy link
Member

Debate: should using not.exist on a path that doesn't exist throw if a property is called on an undefined object?

const obj = {
  foo: {}
}

// should this pass or fail?
cy.wrap(obj).its('foo.bar.baz').should('not.exist')

I believe this should pass because its is a path, and if you're asserting that the path shouldn't exist, then it shouldn't matter whether or not bar exists on the subject.

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