-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
localStorage expected numbers returning strings in jest@23.4.2 update #6795
Comments
This is probably a fix in your |
Can anyone tell me if this fix has been published to npm? |
There is no bug (or fix) for jest here. Jest has nothing to do with local storage, you probably upgraded jsdom |
Looking at the package-lock.json, this is true, jsdom went from |
jsdom implemented localstorage. Your old implementation was buggy, as can be seen by @thymikee's examples |
Yup that was it, thanks for the help! |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
💥 Regression Report
I work on a project that simulates an object store with this module. The global localStorage is set to this simulated version here. The test checks for a number being set in the store. In 23.4.1 this works. In 23.4.2 I get the error
Expected number but received string.
, and the returned value is"1"
and not1
.Possibly related to the update to resolve jsdom/jsdom#2304
Last working version
Worked up to version: 23.4.1
Stopped working in version: 23.4.2
To Reproduce
Hmm… well you could try https://github.com/cfpb/cfgov-refresh#quickstart, update jest in package.json, and run
gulp test:unit
Expected behavior
Data types should not change.
Link to repl or repo (highly encouraged)
See Regression Report.
Run
npx envinfo --preset jest
Paste the results here:
The text was updated successfully, but these errors were encountered: