eslint-plugin-playwright icon indicating copy to clipboard operation
eslint-plugin-playwright copied to clipboard

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

Open EvgenyOrekhov opened this issue 1 year ago • 0 comments
trafficstars

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

EvgenyOrekhov avatar Apr 15 '24 14:04 EvgenyOrekhov