-
Notifications
You must be signed in to change notification settings - Fork 42
Missing playwright expect rule #4
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
Missing playwright expect rule #4
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's awesome! Seems to be similar to https://eslint.org/docs/rules/require-await
@mxschmitt I setup the GH action, and tested it on my fork. You can see the results here: https://github.com/mskelton/eslint-plugin-jest-playwright/actions/runs/794056637 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work!
My team has found that it can be easy to forget to await async playwright matchers such as
toHaveSelector
, which can result in false positives since the test needs to wait for the expectation to work properly. This improves the ESLint plugin to include a new rule that will detect and auto fix this problems. For example, with this input:Auto fixed output: