jefflau / jest-fetch-mock

Jest mock for fetch
MIT License
886 stars 117 forks source link

get trailing/pending mockOnce-mocks #219

Open Xiphe opened 2 years ago

Xiphe commented 2 years ago

When writing integration tests I would like the tests to fail when the implementation does not perform an API call I was expecting.

In some cases the implementation might continue to work even when not doing the API call (for example a tracking/analytics request).

Is there a way to

  1. expect that a fetch call has actually happened (other then using expect.assertions(number))
  2. see the amount of trailing/pending mockOnce-mocks ?

Thanks for the great library!