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

localStorage is not available for opaque origins #10

Open
hemedani opened this issue Aug 2, 2018 · 5 comments
Open

localStorage is not available for opaque origins #10

hemedani opened this issue Aug 2, 2018 · 5 comments

Comments

@hemedani
Copy link

hemedani commented Aug 2, 2018

I have this error when running yarn test

 FAIL  src/modules/user/logout/logout.test.ts
  ● 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>)

 FAIL  src/modules/user/forgotPassword/forgotPassword.test.ts
  ● 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>)

 FAIL  src/modules/user/register/createConfirmEmailLink.test.ts
  ● 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>)

 FAIL  src/modules/user/register/register.test.ts
  ● 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>)

 FAIL  src/routes/confirmEmail.test.ts
  ● 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>)

 FAIL  src/modules/user/me/me.test.ts
  ● 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>)

 FAIL  src/modules/user/login/login.test.ts
  ● 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>)
@benawad
Copy link
Owner

benawad commented Aug 2, 2018

does yarn start work for you?

@philkeys
Copy link

philkeys commented Aug 3, 2018

@hemedani

what worked for me, was within the jest config in package.json I added:

"testEnvironment": "node"

@hemedani
Copy link
Author

hemedani commented Aug 5, 2018

yah yarn start is working

@philkeys
Copy link

philkeys commented Aug 6, 2018

@hemedani Hey, I wanted to let you know that I ended up switching from "testEnvironment": "node" to "testURL": "http://localhost/" later in the videos because the node setting was causing issues with the session testing in Jest—which is around video 16 or 17.

@hemedani
Copy link
Author

hemedani commented Aug 7, 2018

Tanks @philkeys works like a charm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants