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

Bug in no-single-expect-in-then-or-should and no-expect-for-stub #14

Open
DamienCassou opened this issue Jul 4, 2022 · 0 comments
Open

Comments

@DamienCassou
Copy link
Member

If the expect() expression contains several calls, the fixer for the rules no-single-expect-in-then-or-should and no-expect-for-stub will produce invalid JS code.

For example, this test in no-single-expect-in-then-or-should

{
  code: 'cy.then(($a) => {expect($a) .to.have.attr("href").match(/foo/)})',
  errors: [thenError],
  output: 'cy.should("have.attr", "href").should("match", /foo/)',
},

fails because the generated code is invalid:

cy.should("have.attr("href").match", /foo/)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant