kentcdodds / bookshelf

Build a ReactJS App workshop
https://www.epicreact.dev/modules/build-an-epic-react-app-v1/build-an-epic-react-app-welcome
Other
2.66k stars 1.17k forks source link

fix: revert jest-watch-typeahead #220

Closed jacobparis closed 2 years ago

jacobparis commented 2 years ago

In a recent commit, you updated many dependencies including jest-watch-typeahead@1 which does not support jest@26

Attempted solutions

Upgrading to jest@27 returned error on test: internet solutions are always to upgrade Jest to solve, possibly a version+config mismatch?

TypeError: Cannot destructure property 'config' of 'options' as it is undefined

Upgrading to jest@28 returned error on test: internet says Jest's origin URL must be set in jest.config explicitly in order to access the localStorage API. Attempting to add this (even hardcoded to localhost) did not solve this

SecurityError: localStorage is not available for opaque origins

Conclusion

After those two attempts I tried reverting jest-watch-typeahead to the version it was prior to your deps update and all the tests run and pass successfully now.

I uncovered this while running through the start of the module in Gitpod, and I can confirm that after reverting it the tests function correctly again.