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

Throw missing await error on expect.poll #97

Closed
moufmouf opened this issue Aug 28, 2022 · 1 comment · Fixed by #98
Closed

Throw missing await error on expect.poll #97

moufmouf opened this issue Aug 28, 2022 · 1 comment · Fixed by #98

Comments

@moufmouf
Copy link

Hey!

First of all, thanks for this library, it saved my life when I was desperate to find an issue with a Playwright test. Good job, really.

Here is a proposal for a possible improvement:

The expect.poll method can be used to query arbitrary data (not necessarily locators) and in this case, any method called after expect should probably raise a warning.

For instance:

expect.poll(() => { /* some code */ }).toContain('foo');

should probably raise an eslint error about a missing await.

Right now, it is not raising an error, because toContain is not in the list of checked methods for expect.

@mskelton
Copy link
Member

Thanks for reporting this! This will be included in the next release of the plugin.

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