Typescript: buildQueries
should pass Arguments
through to GetErrorFunction
#1037
Labels
buildQueries
should pass Arguments
through to GetErrorFunction
#1037
Uh oh!
There was an error while loading. Please reload this page.
@testing-library/dom
version: 8.6.0 (via@testing-library/[email protected]
Relevant code or config:
This is likely a small oversight from this PR:
https://github.com/testing-library/dom-testing-library/pull/1016/files#diff-bd112f388b709e19de79e65dceba95e350e0cd11b3aa198813c67a0121055792R70-L65
The resulting types:
What you did:
Here's a contrived example of a custom query that takes two arguments. Let's try to use these arguments to show a better error message:
What happened:
The types for the arguments to
GetErrorFunction
are stuck at the default. At runtime, you can log...args
and see that the expectedkey
andvalue
are passed.Reproduction:
I can try to put together a TS repo if you need it, but here's all the code you need to see it:
Problem description:
The types should match the intent and the runtime result and the
GetErrorFunction
s for multiple/none in custom queries should accept the sameArguments
Suggested solution:
Forwarding
Arguments
toGetErrorFunction
should do the trickThe text was updated successfully, but these errors were encountered: