.toBeInstanceOf(Class)

Use .toBeInstanceOf(Class) to check that an object is an instance of a class. This matcher uses instanceof underneath.

  1. class A {}
  2. expect(new A()).toBeInstanceOf(A);
  3. expect(() => {}).toBeInstanceOf(Function);
  4. expect(new A()).toBeInstanceOf(Function); // throws