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

Jest - fix "SecurityError: localStorage is not available for opaque origins" #4371

Merged
merged 1 commit into from
Jul 29, 2018

Conversation

himdel
Copy link
Contributor

@himdel himdel commented Jul 27, 2018

with jsDom 11.12, jest starts failing with

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>)

Looks like jsdom is just trying to follow the browser behaviour more closely, and without testURL jest defaults to assuming "about:blank".

Providing a sane url fixes it.

jestjs/jest#6766
jsdom/jsdom#2304 (comment)

…rigins"

with jsDom 11.12, jest stars failing with

    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>)

Looks like jsdom is just trying to follow the browser behaviour more closely, and without `testURL` jest defaults to assuming "about:blank"
@miq-bot
Copy link
Member

miq-bot commented Jul 27, 2018

Checked commit https://github.com/himdel/manageiq-ui-classic/commit/10e706f4a5414802cc8dad321a3ee63b71089e66 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
0 files checked, 0 offenses detected
Everything looks fine. 🍰

@martinpovolny martinpovolny merged commit 1520493 into ManageIQ:master Jul 29, 2018
@martinpovolny martinpovolny self-assigned this Jul 29, 2018
@martinpovolny martinpovolny added this to the Sprint 91 Ending Jul 30, 2018 milestone Jul 29, 2018
@himdel himdel deleted the jest-fix branch July 30, 2018 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants