Skip to content

New rule for preventing flushing #1011

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

Open
Belco90 opened this issue May 19, 2025 · 0 comments
Open

New rule for preventing flushing #1011

Belco90 opened this issue May 19, 2025 · 0 comments
Assignees
Labels
new rule New rule to be included in the plugin

Comments

@Belco90
Copy link
Member

Belco90 commented May 19, 2025

Name for new rule

no-flush

Description of the new rule

The goal of this rule would be preventing any flush attempt, like await act(() => Promise.resolve()).

I can't think of any other flush mechanism in Testing Library for now, so we can start reporting the previous scenario and add more in the future if needed.

Testing Library feature

Appearance and Disappearance. Usually, dealing with async behaviors is a matter of waiting for something in the UI to appear/disappear.

Testing Library framework(s)

All of them.

What category of rule is this?

Warns about a potential error

Optional: other category of rule

No response

Code examples

await act(() => Promise.resolve())

Anything else?

No response

Do you want to submit a pull request to make the new rule?

Yes

@Belco90 Belco90 added new rule New rule to be included in the plugin triage Pending to be triaged by a maintainer labels May 19, 2025
@Belco90 Belco90 self-assigned this May 19, 2025
@Belco90 Belco90 removed the triage Pending to be triaged by a maintainer label May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new rule New rule to be included in the plugin
Projects
None yet
Development

No branches or pull requests

1 participant