-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix examples + types #77
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 examples + types #77
Conversation
(probably invalid typescript syntax)
c5795ed
to
257d42a
Compare
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.
I'd love it if @maddijoyce could review this as well.
@maddijoyce the typescript syntax is almost certainly wrong 😃 |
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.
The options for getByLabelText need a slight change.
typings/index.d.ts
Outdated
) => HTMLElement | null | ||
getByLabelText: ( | ||
id: TextMatch, | ||
options?: {selector: string; TextMatchOptions}, |
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.
This should probably be
options?: { selector?: string; } & TextMatchOptions
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.
does that mean "all the keys from TextMatchOptions plus selector?"
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.
Yeah that's correct, it's a union type. I also made the selector optional, because it's * by default.
All looks good there now. As far as separating the types into their respective libraries, I'll put a PR through this week. |
The inline type signatures in the README for the wrapped methods don't have the new options yet, but maybe that can be a followup |
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.
Coolio! Thanks friends! 👏
🎉 This PR is included in version 3.0.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
…her than globally (testing-library#77) You have to handle shims yourself if not using jest without this
chore: 🤖 update @babel/preset-env
Closes #76
What:
Update docs to match dom-testing-library v2 api
Why:
How:
Checklist: