Skip to content
This repository was archived by the owner on Sep 19, 2024. It is now read-only.
This repository was 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

@DamienCassou

Description

@DamienCassou

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/)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions