-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
test pass with both expectType and expectNotType, pls help me understand #141
Comments
From TypeScript point of view, everything works as expected. Widening can be suppressed by using But from the user point of view, it's hard to justify why I don't know if there's any other way to fix this besides choosing entirely different API for assertions. If the purpose is to test types, the assertions should use types, not values - one possible API could be assertType<T2>().assignableTo<{a: {b: 1}}>();
assertType<T2>().notAssignableTo<{a: {b: 1}}>(); where functions do not take any arguments - for testing types of values, one will have to use |
I'd think that Related discussion about API changes in #168. |
See #196 for discussion on this. |
This is an amazing library, thanks for it.
can you pls explain why this pass?
I'd expect
expectNotType<T2>({a:{b:1}})
andexpectNotAssignable<T2>({a:{b:1}})
to fail.thanks a lot.
The text was updated successfully, but these errors were encountered: