【问题标题】:How to run client side tests with JHipster v5.8.2 on Windows?如何在 Windows 上使用 JHipster v5.8.2 运行客户端测试?
【发布时间】:2019-04-13 21:27:22
【问题描述】:

我在 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.

【问题讨论】:

  • 听起来像一个错误。你能把它输入到 JHipster 的错误跟踪器中,并附上重现的步骤吗? github.com/jhipster/generator-jhipster/issues
  • 我在 5.8.2 上为 docker './mvnw package -Pprod verify jib:dockerBuild' 打包网关时收到此错误,但在运行默认构建 ./mvnw(Jakub 的解决方法)时没有防止失败。

标签: jhipster


【解决方案1】:

我最近也遇到了这个问题。我从这里使用了解决方法: https://github.com/DorianGrey/ng-webpack-template/pull/22/commits/fe95926607ed8bd01476c7d04b5b930a965ad282

修复:

  1. 打开 jest.conf.js 文件
  2. 替换
testMatch: ['<rootDir>/src/test/javascript/spec/**/+(*.)+(spec.ts)']

testMatch: ['**/*.spec.ts']

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-01-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-10-06
    相关资源
    最近更新 更多