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
[prefer-expect-assertions] allow beforeEach(expect.hasAssertions)
#876
Comments
I can do you one better: you can stick that Overall, I think I'm going to say "maybe" to this - I actually think we should get very close to being able to determine this, but have concerns over edge-cases and the complexity of the code it'd require. Specifically, because we will have to track the nesting of each
Still I think it might be possible based on some of the logic we have in other rules that do similar tracking of nesting that we might be able to do it. |
beforeEach(expect.hasAssertions)
beforeEach(expect.hasAssertions)
Recently I found out that instead of repeating
expect.hasAssertions()
in each test, you can have a singlebeforeEach(expect.hasAssertions)
call at the top of the file.It would be great if
prefer-expect-assertions
could detect file-levelbeforeEach(expect.hasAssertions)
call and NOT give warnings in this case.Current behavior:
Expected behavior:
The text was updated successfully, but these errors were encountered: