Uh oh!
There was an error while loading. Please reload this page.
Use defineProperty on global in setupTests.js - #7421
Conversation
facebook-github-bot
commented
Jul 24, 2019
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
facebook-github-bot
commented
Jul 24, 2019
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
ianschmitz
commented
Aug 12, 2019
Closing as a dupe of #6882. Thanks for the PR! |
I tried to use this code example to mock the localStorage in a unit test. I was getting a "not a mock error", so I eventually ended up doing a
console.log(localStorageMock == global.localStorage)directly after the line I removed in this PR, and it would return false. With this fix, it returns true and my tests are working.