docs: usage with create-react-app now requires explicitly setting resetMocks: false
mfogel opened this issue · comments
Mike Fogel commented
Hi, thanks for this package, appreciate you sharing your work.
Since create react app 4.0, the default jest config has resetMocks: true
set.
This is a bit controversial because it breaks stuff (including this packge).... see facebook/create-react-app#9935 Personally I think they would have been better off to stay conservative and just set clearMocks: true
.
In any case, it might be worth mentioning in the README for this package that:
- setting
resetMocks: true
will break this package - when using create react app, you need to explicitly set
resetMocks: false
Bryan Clark commented
Thanks for the heads up in filing this issue!
If you wouldn't mind updating the README I think the two places that need mention are:
- Module section https://github.com/clarkbw/jest-localstorage-mock#module to include the
resetMocks: false
option - Create React App section https://github.com/clarkbw/jest-localstorage-mock#in-create-react-app to have a note about setting
resetMocks
and link to this issue.
Thanks!