Jest .fn() and .spyOn() spy/stub/mock assertion reference · Code with Hugo

added by JavaScript Kicks
11/6/2019 7:36:22 AM

257 Views

The core assertions we tend to use for spies and stubs are used to answer the following questions: was the stub/spy called? was the stub/spy called the right amount of times? was the stub/spy called with the right arguments/parameters? In Jest, stubs are instantiated with jest.fn() and they're used with expect(stub).


0 comments