Docs: update localStorage mock in “Running Tests”#5919
Merged
iansu merged 1 commit intofacebook:masterfrom Dec 5, 2018
Merged
Conversation
On a project running [redux-persist](https://github.com/rt2zz/redux-persist), declaring the current `localStorage` mock would yield warnings in tests, making them harder to visually grep:  Redux Persists checks for three methods to detect if `localStorage` is defined: `getItem`, `setItem` and `removeItem` ([see relevant code](https://github.com/rt2zz/redux-persist/blob/208c6b112ead87b3701dfacaae2cdbe78377775a/src/integration/getStoredStateMigrateV4.js#L31-L43)). I suggest adding a `removeItem` mock to the docs as it fixes the warnings in tests.
|
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 [email protected]. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
Contributor
|
Thanks! |
timsnadden
added a commit
to timsnadden/create-react-app
that referenced
this pull request
Dec 7, 2018
* master: (39 commits) Added extension to .eslintrc (facebook#5988) Update links to docs in all package README files (facebook#5912) Use https for linked images in docs to fix mixed content warnings (facebook#5985) Improve error messaging in verifyPackageTree.js (facebook#5974) Add removeItem to localStorage mock in docs (facebook#5919) Add SASS_PATH instructions to Sass docs (facebook#5917) Suggest a different default for speed reasons (facebook#5959) Add pre-eject message about new features in v2 (facebook#5954) Add netlify.toml to prepare for deploy to netlify facebook#5807 (facebook#5930) Correct some comments (facebook#5927) Add note to docs about using Sass and Flow together (facebook#5823) Update PWA link in README (facebook#5907) Add placeholders to template README for bit.ly links. (facebook#5808) Disable copy to clipboard in cra --info (facebook#5905) Support setupTests.ts (facebook#5698) Remove unnecessary whitespace in template HTML Run prettier on HTML files (facebook#5839) Some Grammar fixes (facebook#5858) Fix link to page about running tests (facebook#5883) fix: make typescriptformatter support 0.5 of fork checker (facebook#5879) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On a project running redux-persist, declaring the current
localStoragemock would yield warnings in tests, making them harder to visually grep:Redux Persists checks for three methods to detect if
localStorageis defined:getItem,setItemandremoveItem(see relevant code).I suggest adding a
removeItemmock to the docs as it fixes the warnings in tests.