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

npm test SecurityError #2

Open
ConorSheehan1 opened this issue Oct 10, 2018 · 0 comments
Open

npm test SecurityError #2

ConorSheehan1 opened this issue Oct 10, 2018 · 0 comments

Comments

@ConorSheehan1
Copy link

I'm getting an error when trying to run tests using this project.

System: ubuntu 16.04, python3.5, pip 18.0, cookiecutter 1.6.0

pip3 install cookiecutter
cookiecutter https://github.com/ratson/cookiecutter-es6-package.git
cd $the_project
npm install
npm test #SecurityError: localStorage is not available for opaque origins

Full log

cookiecutter https://github.com/ratson/cookiecutter-es6-package.git
You've downloaded /home/$user/.cookiecutters/cookiecutter-es6-package before. Is it okay to delete and re-download it? [yes]: yes
github_repo_name [my-node-package]: test
description [A useful Node package.]: test
github_username [ratson]: test
warning: templates not found /home/$user/.git_template
Initialized empty Git repository in /home/$user/Workspace/test/.git/
[$user@$user-XPS-13-9370:~/Workspace]$ cd test/
[$user@$user-XPS-13-9370:~/Workspace/test]$ ls
package.json  README.md  src
[$user@$user-XPS-13-9370:~/Workspace/test]$ npm install
npm WARN deprecated [email protected]: Switch to the `bfj` package for fixes and new features!
npm WARN deprecated [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.

> [email protected] install /home/$user/Workspace/test/node_modules/husky
> node ./bin/install.js

husky
setting up Git hooks
done


> [email protected] postinstall /home/$user/Workspace/test/node_modules/webpack/node_modules/uglifyjs-webpack-plugin
> node lib/post_install.js

npm WARN prepublish-on-install As of npm@5, `prepublish` scripts are deprecated.
npm WARN prepublish-on-install Use `prepare` for build steps and `prepublishOnly` for upload-only.
npm WARN prepublish-on-install See the deprecation note in `npm help scripts` for more information.

> [email protected] prepublish /home/$user/Workspace/test
> run-s clean build


> [email protected] clean /home/$user/Workspace/test
> del lib dist coverage


> [email protected] build /home/$user/Workspace/test
> cross-env NODE_ENV=production babel --source-maps --out-dir=lib/ src/

src/index.js -> lib/index.js
src/index.test.js -> lib/index.test.js
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 1364 packages from 696 contributors and audited 25764 packages in 17.506s
found 0 vulnerabilities

[$user@$user-XPS-13-9370:~/Workspace/test]$ npm test

> [email protected] pretest /home/$user/Workspace/test
> npm run build


> [email protected] build /home/$user/Workspace/test
> cross-env NODE_ENV=production babel --source-maps --out-dir=lib/ src/

src/index.js -> lib/index.js
src/index.test.js -> lib/index.test.js

> [email protected] test /home/$user/Workspace/test
> run-p test:* lint


> [email protected] test:size /home/$user/Workspace/test
> run-s build size


> [email protected] lint /home/$user/Workspace/test
> eslint --ext js,md .


> [email protected] test:jest /home/$user/Workspace/test
> jest

Determining test suites to run...
> [email protected] build /home/$user/Workspace/test
> cross-env NODE_ENV=production babel --source-maps --out-dir=lib/ src/


 RUNS  lib/index.test.js
 FAIL  src/index.test.js
  ● 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  lib/index.test.js
  ● 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>)

Test Suites: 2 failed, 2 total
Tests:       0 total
Snapshots:   0 total
Time:        0.778s
Ran all test suites.

> [email protected] size /home/$user/Workspace/test
> size-limit

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] test:jest: `jest`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] test:jest script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/$user/.npm/_logs/2018-10-10T16_27_07_488Z-debug.log
ERROR: "test:jest" exited with 1.
npm ERR! Test failed.  See above for more details.
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

1 participant