Skip to content

Latest commit

 

History

History
18 lines (11 loc) · 359 Bytes

expect.md

File metadata and controls

18 lines (11 loc) · 359 Bytes

Expect

Contents

Match an object instance

Jest has a function expect.any to match an instance of the object.

const mock = jest.fn();
class MyObject {}

mock(new MyObject());

expect(mock).toHaveBeenCalledWith(expect.any(MyObject));