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(type): only return Promise with delay #491
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.
Nice! This is great 👍 thank you!
Ugh, we had this build issue elsewhere: rollup/plugins#640 |
type NotVoid = string | number | boolean | object | null | ||
|
||
userEvent.type(element, 'foo', {delay: 1}) as Promise<void> | ||
// @ts-expect-error No delay returns void |
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 usage of typescript this was new to me many thanks! ❤️
Codecov Report
@@ Coverage Diff @@
## master #491 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 13 13
Lines 615 615
Branches 200 200
=========================================
Hits 615 615 Continue to review full report at Codecov.
|
🎉 This PR is included in version 12.2.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
That's strange, the codecov support says 100% coverage. Is that incorrect or only for the files in this PR? |
Yeah, very odd. I just ran it locally out of curiosity and got that result. But this build succeeded and the library got published so 🤷♂️ |
I just pulled, deleted |
What: The TypeScript type for the
type
function will now only return aPromise
when given adelay
option.Why: #480
How: Updated type declaration and added basic type tests.
Checklist: