Does it make sense to throw a type error if a value cannot be null for the .toBeNull helper? For example, in the following test I WOULD expect a type error if the type cannot be null:
it("cannot be null",()=>{constx: number=1;expect(x).toBeNull(); # Throwatypeerrorheresince`x`canonlybeanumber?
});I WOULD NOT expect a type error if the value can be null. For example, in this test:
it("cannot be null",()=>{constx: number|null=1;expect(x).toBeNull();});Let me know if that makes sense.
Does it make sense to throw a type error if a value cannot be null for the
.toBeNullhelper? For example, in the following test I WOULD expect a type error if the type cannot be null:I WOULD NOT expect a type error if the value can be
null. For example, in this test:Let me know if that makes sense.