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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

SecurityError: localStorage is not available for opaque origins #6769

Closed
Ektomorfik opened this issue Jul 27, 2018 · 8 comments

Comments

Projects
None yet
8 participants
@Ektomorfik
Copy link

commented Jul 27, 2018

馃悰 Bug Report

Hi guys!
I've made setup without create-react-app and when I try to run tests I got error:
image

Test is very simple :
it('first test', () => {
expect(123).toBe(123)
})

Expected behavior

I'd like to be able to pass my tests

@henrikbjorn

This comment has been minimized.

Copy link

commented Jul 27, 2018

I see this also

@creamidea

This comment has been minimized.

Copy link

commented Jul 27, 2018

related to jsdom/jsdom#2304

You can set the testURL of the jest configuration like this:

  "jest": {
    "verbose": true,
    "testURL": "http://localhost/"
  }
@Ektomorfik

This comment has been minimized.

Copy link
Author

commented Jul 27, 2018

Ok. The fix is to set testURL: "http://localhost/" in jest config.
But I have another problem. All running process is very slow, It last about 5-7 sec even if I run my tests with --watch.
Anyone knows how to increase performance?
Fast fix: I changed my Jest version from "23.4.1" to "22.4.1"

@csvan

This comment has been minimized.

Copy link

commented Jul 27, 2018

Duplicate: #6766

@akuji1993

This comment has been minimized.

Copy link

commented Jul 30, 2018

For anyone just starting to use Jest and running into this error, this is how you define a Jest configuration: https://jestjs.io/docs/en/configuration.html

ot-raypeters added a commit to ot-raypeters/design-tokens that referenced this issue Jul 31, 2018

@matttk

This comment has been minimized.

Copy link

commented Aug 1, 2018

Update: setting testURL works. I had a different problem, with my babelrc.

When I set testURL, I get a new error at all instances of import Enzyme

SyntaxError: Unexpected token import

Not sure if this is related to react-sass-starterkit test setup or not, since this is my first time trying to do react testing with jest...

lastquestion added a commit to opentable/design-tokens that referenced this issue Aug 1, 2018

@mikefogg mikefogg referenced this issue Aug 1, 2018

Merged

Fixing readme #13

2zH added a commit to pluginjs/pluginjs that referenced this issue Aug 2, 2018

bmaupin added a commit to bmaupin/langtrends-api that referenced this issue Aug 2, 2018

arb added a commit to arb/celebrate that referenced this issue Aug 2, 2018

Added testUrl
Fixes issue with local storage on CI.
Related to facebook/jest#6769

petermikitsh added a commit to petermikitsh/react-router that referenced this issue Aug 2, 2018

petermikitsh added a commit to petermikitsh/react-router that referenced this issue Aug 2, 2018

petermikitsh added a commit to petermikitsh/react-router that referenced this issue Aug 2, 2018

petermikitsh added a commit to petermikitsh/react-router that referenced this issue Aug 2, 2018

mythz added a commit to NetCoreTemplates/vue-spa that referenced this issue Aug 3, 2018

@hiimbex hiimbex referenced this issue Aug 3, 2018

Merged

C H E C K S A P I S U P P O R T 馃ぉ #79

2 of 2 tasks complete

LinFeng1997 added a commit to docschina/vuepress that referenced this issue Aug 4, 2018

缈昏瘧service worker 閮ㄥ垎 (#20)
* chore: remove override.styl

* refactor: changelog

* feat: transform Badge into async component

* fix: set babelrc: false in babel-loader options (vuejs#644)

Prevents picking up local `.babelrc` file in projects.

* docs($cn): update for new file-level API: style.styl.

* feat($pwa): add themeConfig.serviceWorker.updatePopup option (close: vuejs#453) (vuejs#533)

* docs: tweaks

* docs: enable serviceWorker.updatePopup

* chore: update register-service-worker to latest

* docs($cn): tweaks (vuejs#652)

* refactor($release): let [enter] pass next step (vuejs#650)

* chore: fix code snippet typo (missing semi-colon) (vuejs#658)

* docs: tweaks lastUpdated (vuejs#663)

* fix: scoped styles of badge component (close: vuejs#653) (vuejs#657)

* fix($build): markdown config should be included in cache identifier

It's reported by vuejs#664, but vuejs#664 cannot be fixed fully since watching webpack config changes shouldn't be handled in VuePresss

VuePress can only ensure that when user changes the markdown config, the cache identifier will be updated, so user needn't to clean the ./node_modules/.cache manually.

See: webpack/webpack#3153, webpack/webpack-cli#15

* workflow: update issue template - add more guidelines

* feat($cli): debug flag at dev mode

reason for this feature: webpack-bar will wipe out the debug log at dev mode.

* fix($seo): Avoid duplicate description meta at runtime. (close: vuejs#665)

* refactor: code style

Follow the official code style guide, refs:

1. https://vuejs.org/v2/style-guide/#Multi-attribute-elements-strongly-recommended
2. https://vuejs.org/v2/style-guide/#Empty-lines-in-component-instance-options-recommend
3. https://github.com/vuejs/ui

* fix($markdown): cannot highlight external python file (.py) correctly (close: vuejs#660)

* fix: missing space between italics and bold (close: vuejs#661)

"markdown-it" will intendedly reserve this space, and this issue was caused by "preserveWhitespace: true" (See: https://github.com/vuejs/vue/tree/dev/packages/vue-template-compiler#options),

Impact on performance (Size of whole assets): Before (1952K), After (1960K), which is an acceptable change.

* chore: add alt attribute to logo image (vuejs#672)

* fix($build): exclude dest folder from pageFiles (close: vuejs#654) (vuejs#655)

* refactor: naming and comments (vuejs#655)

* chore: update deps

* test: fix SecurityError: localStorage is not available for opaque origins

ref: facebook/jest#6769

* 0.13.0

* chore: changelog

* chore: enhance changelog

* docs: i18n for serviceWorker.updatePopup

* docs($cn): document for themeConfig.serviceWorker.updatePopup

* chore: changelog

* docs: update reamde - add SW-update popup

* docs: document i18n example for SW-update popup

* docs: document beta status for SW-update popup

ref: vuejs#677

* fix: py lang label doesn't display in code block (vuejs#690)

* fix: normalize override file path in windows (vuejs#692) (close: vuejs#642)

* 0.13.1

* chore: changelog

* 鎻愪氦first缈昏瘧

brynachj added a commit to brynachj/js_canvas_shmup that referenced this issue Aug 4, 2018

Fixed jest configuration in package.json so that it actually runs ins鈥
鈥ead of having security issues (see 鈭=facebook/jest#6769).

Added first test - simple mock/expectation test to enemyService.test.js

selmertsx added a commit to speee/iiopt that referenced this issue Oct 18, 2018

set testURL options to jest.config.js
Because the following error occurred.
facebook/jest#6769 (comment)
@EParedez

This comment has been minimized.

Copy link

commented Nov 11, 2018

If use vue-cli, only necesary agregate to MyProjectVueCli/test/unit/jest.config.js

 .. 
 ..
  collectCoverageFrom: [
   ..
    '!**/node_modules/**'
  ],
  **testURL:"http://localhost:8080"**
}

skogsmaskin added a commit to sanity-io/sanity that referenced this issue Dec 14, 2018

skogsmaskin added a commit to sanity-io/sanity that referenced this issue Dec 14, 2018

skogsmaskin added a commit to sanity-io/sanity that referenced this issue Dec 14, 2018

skogsmaskin added a commit to sanity-io/sanity that referenced this issue Dec 14, 2018

skogsmaskin added a commit to sanity-io/sanity that referenced this issue Dec 14, 2018

skogsmaskin added a commit to sanity-io/sanity that referenced this issue Dec 14, 2018

skogsmaskin added a commit to sanity-io/sanity that referenced this issue Dec 14, 2018

skogsmaskin added a commit to sanity-io/sanity that referenced this issue Dec 14, 2018

skogsmaskin added a commit to sanity-io/sanity that referenced this issue Dec 14, 2018

skogsmaskin added a commit to sanity-io/sanity that referenced this issue Dec 14, 2018

skogsmaskin added a commit to sanity-io/sanity that referenced this issue Dec 14, 2018

skogsmaskin added a commit to sanity-io/sanity that referenced this issue Dec 14, 2018

skogsmaskin added a commit to sanity-io/sanity that referenced this issue Dec 14, 2018

skogsmaskin added a commit to sanity-io/sanity that referenced this issue Dec 14, 2018

skogsmaskin added a commit to sanity-io/sanity that referenced this issue Dec 14, 2018

skogsmaskin added a commit to sanity-io/sanity that referenced this issue Dec 14, 2018

skogsmaskin added a commit to sanity-io/sanity that referenced this issue Dec 14, 2018

[chore] Set testURL for Jest to avoid facebook/jest#6769
[util] Set testURL for Jest to avoid facebook/jest#6769

[validation] Set testURL for Jest to avoid facebook/jest#6769

[schema] Set testURL for Jest to avoid facebook/jest#6769

[export] Set testURL for Jest to avoid facebook/jest#6769

skogsmaskin added a commit to sanity-io/sanity that referenced this issue Dec 17, 2018

[chore] Set testURL for Jest to avoid facebook/jest#6769
[util] Set testURL for Jest to avoid facebook/jest#6769

[validation] Set testURL for Jest to avoid facebook/jest#6769

[schema] Set testURL for Jest to avoid facebook/jest#6769

[export] Set testURL for Jest to avoid facebook/jest#6769

skogsmaskin added a commit to sanity-io/sanity that referenced this issue Dec 17, 2018

[chore] Set testURL for Jest to avoid facebook/jest#6769
[util] Set testURL for Jest to avoid facebook/jest#6769

[validation] Set testURL for Jest to avoid facebook/jest#6769

[schema] Set testURL for Jest to avoid facebook/jest#6769

[export] Set testURL for Jest to avoid facebook/jest#6769

skogsmaskin added a commit to sanity-io/sanity that referenced this issue Dec 17, 2018

[chore] Set testURL for Jest to avoid facebook/jest#6769
[util] Set testURL for Jest to avoid facebook/jest#6769

[validation] Set testURL for Jest to avoid facebook/jest#6769

[schema] Set testURL for Jest to avoid facebook/jest#6769

[export] Set testURL for Jest to avoid facebook/jest#6769

skogsmaskin added a commit to sanity-io/sanity that referenced this issue Dec 17, 2018

[chore] Set testURL for Jest to avoid facebook/jest#6769
[util] Set testURL for Jest to avoid facebook/jest#6769

[validation] Set testURL for Jest to avoid facebook/jest#6769

[schema] Set testURL for Jest to avoid facebook/jest#6769

[export] Set testURL for Jest to avoid facebook/jest#6769

zenware added a commit to zenware/fl-maps that referenced this issue Dec 18, 2018

bjoerge added a commit to sanity-io/sanity that referenced this issue Dec 18, 2018

[chore] Set testURL for Jest to avoid facebook/jest#6769
[util] Set testURL for Jest to avoid facebook/jest#6769

[validation] Set testURL for Jest to avoid facebook/jest#6769

[schema] Set testURL for Jest to avoid facebook/jest#6769

[export] Set testURL for Jest to avoid facebook/jest#6769

skogsmaskin added a commit to sanity-io/sanity that referenced this issue Dec 18, 2018

[chore] Set testURL for Jest to avoid facebook/jest#6769
[util] Set testURL for Jest to avoid facebook/jest#6769

[validation] Set testURL for Jest to avoid facebook/jest#6769

[schema] Set testURL for Jest to avoid facebook/jest#6769

[export] Set testURL for Jest to avoid facebook/jest#6769

bjoerge added a commit to sanity-io/sanity that referenced this issue Dec 18, 2018

[chore] Set testURL for Jest to avoid facebook/jest#6769
[util] Set testURL for Jest to avoid facebook/jest#6769

[validation] Set testURL for Jest to avoid facebook/jest#6769

[schema] Set testURL for Jest to avoid facebook/jest#6769

[export] Set testURL for Jest to avoid facebook/jest#6769

j123 added a commit to j123/vMock that referenced this issue Mar 17, 2019

shaun554 added a commit to shaun554/vuepress that referenced this issue Mar 21, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.