Skip to content

Fix typings for double-bound functions#139

Merged
kentcdodds merged 2 commits into
testing-library:masterfrom
jgoz:fix-typings
Oct 25, 2018
Merged

Fix typings for double-bound functions#139
kentcdodds merged 2 commits into
testing-library:masterfrom
jgoz:fix-typings

Conversation

@jgoz

@jgoz jgoz commented Oct 25, 2018

Copy link
Copy Markdown
Contributor

What:

Typings were wrong for queryByTestId and other double-bound query functions.

Fixes #135.

Why:

Some helper functions have 4 arguments (QueryByAttribute, AllByAttribute) because they are bound once for the attribute, and then again for the container.

How:

Added a 4-argument case to the conditional type in BoundFunction.

Checklist:

  • Documentation N/A
  • Tests N/A
  • Ready to be merged
  • Added myself to contributors table

Tested in my personal repositories and the typing errors disappeared.

@kentcdodds kentcdodds merged commit 933aab4 into testing-library:master Oct 25, 2018
@jgoz jgoz deleted the fix-typings branch October 26, 2018 01:54
@kentcdodds

Copy link
Copy Markdown
Member

🎉 This PR is included in version 3.12.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

Types for queryByTestId not correct

2 participants