我在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
固定:
testMatch: ['<rootDir>/src/test/javascript/spec/**/+(*.)+(spec.ts)']
同
testMatch: ['**/*.spec.ts']