[expect-type]: Allow negation of toBeCallableWith
#6
Labels
documentation
Improvements or additions to documentation
toBeCallableWith
#6
I've noticed it's impossible to check for a function to not be callable with arguments
https://github.com/mmkal/ts/blob/main/packages/expect-type/src/index.ts#L111
In case of negated assertion, the check property is
never
.So. I've tweaked around and I think the issue is that typing errors are generated during the last call, where type parameters are merged to generate a
MISMATCH
, spread as a rest parameter to generate type that can never be instantiated properly. But the current format oftoBeCallableWith
already takes a rest parameter for args.So, here is the proposal: create a new method that takes arguments not as a rest tuple, but as a single tuple. Something like this:
Thoughts ?
The text was updated successfully, but these errors were encountered: