jhipster - 如何在 Windows 上使用 JHipster v5.8.2 运行客户端测试?
问题描述
我在 Windows 操作系统上使用 JHipster v5.8.2,并尝试通过运行以下命令来运行 Jest 客户端测试:
npm test
但我收到一条错误消息:
No tests found, exiting with code 1
Run with `--passWithNoTests` to exit with code 0
In C:\IdeaProjects\pomzen
274 files checked.
testMatch:
C:/IdeaProjects/pomzen/src/test/javascript/spec/**\+(*.)+(spec.ts) - 0
matches
testPathIgnorePatterns: \\node_modules\\ - 274 matches
testRegex: - 0 matches
Pattern: - 0 matches
npm ERR! Test failed. See above for more details.
解决方案
我最近也遇到了这个问题。我从这里使用了解决方法: https ://github.com/DorianGrey/ng-webpack-template/pull/22/commits/fe95926607ed8bd01476c7d04b5b930a965ad282
使固定:
- 打开jest.conf.js文件
- 代替
testMatch: ['<rootDir>/src/test/javascript/spec/**/+(*.)+(spec.ts)']
和
testMatch: ['**/*.spec.ts']
推荐阅读
- javascript - 对于数组完成之前的每个循环中断
- java - 检查任务计划状态
- java - 我如何获得给定数组的频率?
- python - Pandas 系列的条件乘法
- python - TensorFlow Lite:toco_convert 用于任意大小的输入张量
- apache - Apache vhost:别名和 RewriteRule
- chart.js - 无法在图表js中的画布上设置宽度和高度
- android - 通过带有身份验证的代理的 OkHttp 请求失败
- python - 使用 Pyinstaller 的 ModalView 间歇性失败
- emacs - spacemacs“文件模式规范错误”