expectTypeOf
allows an incorrect any
value instead of the specified type
#4205
Labels
expectTypeOf
allows an incorrect any
value instead of the specified type
#4205
Describe the bug
When I use
expectTypeOf
, I expect it to fail when I passany
as input. For example,toBeString()
should strictly only allow strings and not any other type...includingany
.This is particular useful in cases when your types reason about
any
, I need to strictly know that a type will fail if itsany
or not. For example:If I use
CustomType
somewhere, I'd like to testexpectTypeOf(value).toBeNumber();
and have it fail if it's any when I don't expect it to be.Reproduction
System Info
Used Package Manager
pnpm
Validations
The text was updated successfully, but these errors were encountered: