Skip to content
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

[Bug] prefer-to-have-count false positive #207

Closed
CreativeTechGuy opened this issue Jan 31, 2024 · 1 comment · May be fixed by organich/eslint-plugin-playwright#1
Closed

[Bug] prefer-to-have-count false positive #207

CreativeTechGuy opened this issue Jan 31, 2024 · 1 comment · May be fixed by organich/eslint-plugin-playwright#1
Labels

Comments

@CreativeTechGuy
Copy link

Currently prefer-to-have-count checks for 3 things within the expect call:

  • an await expression
  • a function call
  • a member expression

This rule should be specifically checking for the method .count() like the name describes. Currently it picks up other things like the following:

expect(await page.evaluate(() => {
    return document.querySelectorAll("*").length;
})).toBe(10);

That sample above is incorrectly reported as an error since it matches all of the 3 conditions despite it not being a .toHaveCount() compatible call.

Thank you! :)

Copy link

github-actions bot commented Feb 3, 2024

🎉 This issue has been resolved in version 0.22.2 🎉

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

Successfully merging a pull request may close this issue.

1 participant