我在 gitlab 作业中有以下输出:
yarn run v1.15.2
$ jest --verbose
No tests found
In /path/to/my/project/
47 files checked.
testMatch: - 47 matches
testPathIgnorePatterns: /node_modules/,/build,/lib/ - 0 matches
testRegex: (/__tests__/.*|\.(test|spec))\.(tsx?|jsx?)$ - 1 match
Pattern: - 0 matches
测试没有被执行,我在这里做错了什么?我在其他项目中使用了相同的 gitlab-ci.yml 配置。
如有任何帮助,我们将不胜感激!
最佳答案
是的,错误在package.json中,我在jest选项下的testPathIgnorePatterns和modulePathIgnorePatterns路径中缺少<rootDir>。
"testPathIgnorePatterns": [
"<rootDir>/node_modules/",
"<rootDir>/build",
"<rootDir>/lib/"
],
"modulePathIgnorePatterns": [
"<rootDir>/dist/",
"<rootDir>/build/"
]
关于gitlab - 未找到开 Jest 测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55901514/