-
Notifications
You must be signed in to change notification settings - Fork 470
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
Types for queryByTestId not correct #135
Comments
Looks like this might be a regression from 3.11.1 PR #130. |
I do not understand typescript very well, but it looks like the arguments for the The |
I can confirm that removing line 8 makes the types work again. I don't know if that is the correct solution though or not. On a different note, I am curious why the same typing was not applied to the |
This is happening because the argument order for |
* fix(typings): handle double-bound functions fixes #135 * Add contributor
🎉 This issue has been resolved in version 3.12.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
dom-testing-library
version: 3.11.2Relevant code or config:
What you did:
Used
queryByTestId
in typescriptWhat happened:
VSCode gives error that more arguments are expected
Problem description:
Looks like
queryByTestId
uses thequeryByAttribute
type: https://github.com/kentcdodds/dom-testing-library/blob/master/typings/queries.d.ts#L52, even thought theattribute
argument is automatically bound: https://github.com/kentcdodds/dom-testing-library/blob/master/src/queries.js#L153.Suggested solution:
Add a new type or pick the keys off the
queryByAttribute
type.The text was updated successfully, but these errors were encountered: