Closed ishmaelthedestroyer closed 2 years ago
lol sorry. you can't use a beforeEach
in a helper library. That would break in so many ways I can't tell you. Someone simply having a test with a beforeEach
outside of a describe block would break it.
Sorry man, definitely not going to accept this in any form.
Overview When developers set
resetMock
totrue
in theirjest.config.js
, it breaks the automocking. This can be seen by errors surfacing sayingisMocking is not a function or its return value is not iterable
or related.This fixes that issue by resetting the
isMocking
and globalfetch
functions by resetting their values in abeforeEach
call.A PR has been opened in the original repo here: https://github.com/jefflau/jest-fetch-mock/pull/197