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

fix(types): correct type annotation for act #288

Merged
merged 1 commit into from
Jan 24, 2024
Merged

fix(types): correct type annotation for act #288

merged 1 commit into from
Jan 24, 2024

Conversation

mcous
Copy link
Collaborator

@mcous mcous commented Jan 24, 2024

The implementation of act() requires a function, but the type annotation says it takes either a function or a Promise.

After checking out the history, I found this mismatch was created by #54, which added both the type annotation and implementation for act. This leads me to think the best path forward now is to simply adjust the type annotation to match reality, rather than updating the implementation to support a Promise.

Closes #134

@yanick
Copy link
Collaborator

yanick commented Jan 24, 2024

Sounds sane! 👍

@yanick yanick merged commit 9ef86c7 into testing-library:main Jan 24, 2024
5 checks passed
Copy link

🎉 This PR is included in version 4.0.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

@mcous mcous deleted the fix-134 branch January 24, 2024 19:40
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 this pull request may close these issues.

TypeScript definition of act() function allows Promise as a parameter, but code fails if Promise is provided
2 participants