Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
EvgenyOrekhov opened this issue Apr 15, 2024 · 1 comment
Closed

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

EvgenyOrekhov opened this issue Apr 15, 2024 · 1 comment
Labels

Comments

@EvgenyOrekhov
Copy link

EvgenyOrekhov commented Apr 15, 2024

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

🎉 This issue has been resolved in version 1.7.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant