我在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.
答案 0 :(得分:1)
我最近也遇到了这个问题。我从这里使用解决方法: https://github.com/DorianGrey/ng-webpack-template/pull/22/commits/fe95926607ed8bd01476c7d04b5b930a965ad282
修复:
testMatch: ['<rootDir>/src/test/javascript/spec/**/+(*.)+(spec.ts)']
使用
testMatch: ['**/*.spec.ts']