Uh oh!
There was an error while loading. Please reload this page.
Updated the example for mocking the localstorage - #6882
Conversation
The mocking example for the `localStorage` which was provided earlier was breaking after the recent `jest` update (using `CRA - v3.0`). I've updated the example to mock through the `Storage` api. Sample code sandbox: https://codesandbox.io/s/43pn52xmz0?fontsize=14&previewwindow=tests
email2vimalraj
commented
Apr 24, 2019
Look like the travis is hung. |
iansu
commented
Apr 24, 2019
Is this documented somewhere with Jest? I'd like to verify that this is correct before we change it. |
email2vimalraj
commented
Apr 26, 2019
I couldn't find anything related to this in their documentation. However whatever the snippet provided in our documentation doesn't work after the upgrade. The code sandbox link proves that. |
email2vimalraj
commented
May 4, 2019
@iansu : Any comments? |
ianschmitz
commented
May 4, 2019
We were on an old version of Jest/jsdom previously which was lacking a Some relevant info: |
ianschmitz
commented
May 4, 2019
This may be a good solution: jestjs/jest#6798 (comment). It isn't overriding the implementation of |
email2vimalraj
commented
Aug 28, 2019
Sorry for not replying or not taking any action against the comment. Do you want me to resubmit this PR with your recommendation? |
pjg
commented
Jun 23, 2022
Using |
The mocking example for the
localStoragewhich was provided earlier was breaking after the recentjestupdate (usingCRA - v3.0). I've updated the example to mock through theStorageapi.Sample code sandbox: https://codesandbox.io/s/43pn52xmz0?fontsize=14&previewwindow=tests