Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant