-
-
Notifications
You must be signed in to change notification settings - Fork 68
expectError strict behaviour #40
Copy link
Copy link
Open
Labels
help wantedExtra attention is neededExtra attention is neededquestionFurther information is requestedFurther information is requested
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is neededquestionFurther information is requestedFurther information is requested
Type
Fields
Give feedbackNo fields configured for issues without a type.
I need feedback on the behaviour of the
expectErrorassertion.The
expectTypeassertion is strict. Which means thatexpectType<string | number>(concat('a', 'b'))will fail becausestring | numberis defined too wide. See the docs.I didn't change anything for
expectErroras I wasn't sure on the exact behaviour.@cartant asked if it would behave like this (see ReactiveX/rxjs#4871 (comment)).
The reason behind it could be that because the type is too wide, the assertion is an error and that's what you expect.
I also discussed this with @sindresorhus and he indicated that maybe we should hard fail on that assertion.
I definitely could use feedback on this topic here :).
// @BendingBender