使用jhipster 5.1.0进行客户端测试失败

编程入门 行业动态 更新时间:2024-10-11 21:29:31
本文介绍了使用jhipster 5.1.0进行客户端测试失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用jhipster 5.1.0,并且当我生成一个新的Monolith应用程序(使用默认选项)并运行yarn test时,它失败,并显示以下输出:

I'm using jhipster 5.1.0 and when I generate a new monolith app [using default options] and I run yarn test , it fails with the following output :

$ yarn test yarn run v1.7.0 $ yarn run lint && jest --coverage --logHeapUsage -w=2 --config src/test/javascript/jest.conf.js $ tslint --project tsconfig.json -e 'node_modules/**' No valid rules have been specified FAIL src/test/javascript/spec/app/admin/health/healthponent.spec.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/test/javascript/spec/app/shared/login/loginponent.spec.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/test/javascript/spec/app/admin/audits/auditsponent.spec.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/test/javascript/spec/app/account/password-reset/init/password-reset-initponent.spec.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/test/javascript/spec/app/admin/audits/audits.service.spec.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>) ----------|----------|----------|----------|----------|-------------------| File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | ----------|----------|----------|----------|----------|-------------------| All files | 0 | 0 | 0 | 0 | | ----------|----------|----------|----------|----------|-------------------| Test Suites: 16 failed, 16 total Tests: 0 total Snapshots: 0 total Time: 2.353s Ran all test suites. error Command failed with exit code 1.

这是一个错误还是我在本地丢失了一些东西?

is it a bug or I'm missing something locally ?

推荐答案

好像是个错误.

尝试将其添加到src/test/javascript/jest.conf.js的底部:

Try to add this at the bottom of src/test/javascript/jest.conf.js:

testEnvironment: "node", testUrl: "localhost/"

更多推荐

使用jhipster 5.1.0进行客户端测试失败

本文发布于:2023-10-30 18:20:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1543637.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:客户端   测试   jhipster

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!