Skip to content

prefer-to-have-count: warn about .toHaveLength() #284

Closed
@EvgenyOrekhov

Description

@EvgenyOrekhov

It's a feature request to add one more case to prefer-to-have-count rule.

The following code should be considered invalid:

expect(await page.getByText("test").all()).toHaveLength(2);

The following code should be considered valid:

await expect(page.getByText("test")).toHaveCount(2);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions