A set of useful mocks and helpers for the Jest unit testing framework.
All provided helpers have full TypeScript support with inferred types based on the arguments they're called with.
Returns an array of calls from the provided Jest Mock, where args
matches the args the mock was
called with.
Returns the first matching call from the provided Jest Mock, where args
matches the args the mock
was called with.
Returns a Promise
that will instantly resolve with the provided value
.
Returns a Promise
that will instantly be rejected with the provided error
.
Returns an async
Jest Mock that will instantly resolve with the provided value
when called.
Returns an async
Jest Mock that will instantly be rejected with the provided error
when called.