toBeTypeOf
Asserts that the value is of given type.
toBeTypeOf(typeStr: string): void
Example
// this succeeds:
expect("foo").toBeTypeOf("string");
expect(123).toBeTypeOf("number");
expect(null).toBeTypeOf("object");
// this fails:
expect(undefined).toBeTypeOf("object");
Related
- class AssertionRepresents a value ready to be asserted.