Closed ishmaelthedestroyer closed 3 years ago
While I appreciate the work you've done on this PR, calling "beforeEach" in a dependent library (i.e. this library) is not something I'd be ok with. That would break in many ways you probably aren't foreseeing as any test that has a "beforeEach" outside of a describe block would have its beforeEach overwritten (or would override the one you added) by your code.
If you wanted to submit a PR that provided the beforeEach function implementation and updated the readme with instructions how to use it, I'd consider it.
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.