Skip to content
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

Update testURL default value from about:blank to localhost #6792

Merged
merged 3 commits into from
Aug 1, 2018

Conversation

palmerj3
Copy link
Contributor

@palmerj3 palmerj3 commented Aug 1, 2018

Summary

Updates jests default value for testURL from 'about:blank' to 'http://localhost'.
This ensures that JSDOM doesn't throw a security error for tests using the jsdom environment.

Should fix #6766

Test plan

All tests pass

cc @thymikee @SimenB

@thymikee thymikee requested a review from SimenB August 1, 2018 11:36
@codecov-io
Copy link

Codecov Report

Merging #6792 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #6792   +/-   ##
=======================================
  Coverage   63.66%   63.66%           
=======================================
  Files         235      235           
  Lines        9010     9010           
  Branches        3        3           
=======================================
  Hits         5736     5736           
  Misses       3273     3273           
  Partials        1        1
Impacted Files Coverage Δ
packages/jest-config/src/valid_config.js 100% <ø> (ø) ⬆️
packages/jest-config/src/defaults.js 100% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fb2a6ac...b732507. Read the comment docs.

@SimenB
Copy link
Member

SimenB commented Aug 1, 2018

needs a changelog entry

@palmerj3
Copy link
Contributor Author

palmerj3 commented Aug 1, 2018

I always forget this :)

Pushing now

@Vinnl
Copy link
Contributor

Vinnl commented Aug 2, 2018

@palmerj3 & @SimenB: the changelog lists it under 23.4.2, but since that was released five days ago, I don't suppose it's in there already?

@thymikee
Copy link
Collaborator

thymikee commented Aug 2, 2018

Yea @Vinnl, it was a mistake, fixing it: #6799

@ljharb
Copy link
Contributor

ljharb commented Aug 2, 2018

When will this be released?

ljharb added a commit to airbnb/react-component-variations that referenced this pull request Aug 2, 2018
ljharb added a commit to airbnb/react-component-variations that referenced this pull request Aug 3, 2018
@thymikee
Copy link
Collaborator

thymikee commented Aug 3, 2018

@mjesun mind releasing a patch?

christinebrass added a commit to TrueCar/gluestick that referenced this pull request Aug 10, 2018
abetomo added a commit to abetomo/webpack that referenced this pull request Aug 13, 2018
The following errors were fixed.
```
  ● Test suite failed to run

      SecurityError: localStorage is not available for opaque origins

            at Window.get localStorage [as localStorage]
            (node_modules/jsdom/lib/jsdom/browser/Window.js:257:15)
                      at Array.forEach (<anonymous>)
```

* https://github.com/facebook/jest/blob/master/CHANGELOG.md#2350
    * jestjs/jest#6792
abetomo added a commit to abetomo/node-ss2json that referenced this pull request Aug 13, 2018
abetomo added a commit to abetomo/node-ss2json that referenced this pull request Aug 19, 2018
aduth added a commit to WordPress/gutenberg that referenced this pull request Sep 12, 2018
Avoids issues with localStorage in JSDOM 11.12

Can be removed when running Jest 23.5.0 or newer

See: jestjs/jest#6766
See: jestjs/jest#6792
aduth added a commit to WordPress/gutenberg that referenced this pull request Sep 13, 2018
Avoids issues with localStorage in JSDOM 11.12

Can be removed when running Jest 23.5.0 or newer

See: jestjs/jest#6766
See: jestjs/jest#6792
mlazowik added a commit to mlazowik/create-react-app that referenced this pull request Sep 16, 2018
aduth added a commit to WordPress/gutenberg that referenced this pull request Sep 17, 2018
* Framework: Replace element-closest with registered vendor script

* Scripts: Add support for license ignore

* Framework: Re-pin to newer version of JSDOM

Newer version is SemVer-compatible with jest-environment-jsdom and includes support for Element#closest out of the box.

jsdom/jsdom#1555

Required to ignore license validation for abab because while it is a compatible license (BSD 3-clause), the package's `license` field is malformed for parse.

https://github.com/jsdom/abab/blob/4327de3aae348710094d9f3c1f0c1477d9feb865/package.json#L26
https://github.com/jsdom/abab/blob/master/LICENSE.md

* Testing: Add dummy testURL for Jest config

Avoids issues with localStorage in JSDOM 11.12

Can be removed when running Jest 23.5.0 or newer

See: jestjs/jest#6766
See: jestjs/jest#6792

* Licenses: Add BSD-3-Clause W3C variant as an allowed license

Also, check if the license defined in package.json is telling us to look in the license file, instead.

* Package: Scripts: Use String#includes for improved code clarity

* Package: Scripts: Add CHANGELOG notes for improved license file detection
evanpurkhiser added a commit to getsentry/sentry that referenced this pull request Jan 8, 2019
The failed tests that had to be fixed relate to jestjs/jest#6792
evanpurkhiser added a commit to getsentry/sentry that referenced this pull request Jan 8, 2019
The failed tests that had to be fixed relate to jestjs/jest#6792
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSDom 11.12 causes SecurityError: localStorage is not available for opaque origins
7 participants