Go to repository

Function toHaveType

Answers if the actual value has a type matching the expected type, checked by using the typeof operator.

`toHaveType('hello', 'string')` returns `true`.

Parameters

  • actual: unknown
  • expectedType: string

Returns boolean