eslint-plugin-playwright
eslint-plugin-playwright copied to clipboard
prefer-to-have-count: warn about `.toHaveLength()`
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);