-6ren">
gpt4 book ai didi

jestjs - 如何在 Windows 10 上修复 Jest "No Tests Found"?

转载 作者:行者123 更新时间:2023-12-03 09:29:23 25 4
gpt4 key购买 nike

我正在尝试在我的 Windows 10 台式计算机上使用 Jest,但它一直告诉我没有找到任何测试。在我的 Windows 10 笔记本电脑上,它工作得很好。这是我在桌面上得到的输出:

C:\app> jest
No tests found
In C:\app
25163 files checked.
testMatch: **/__tests__/**/*.js?(x),**/?(*.)(spec|test).js?(x) - 743 matches
testPathIgnorePatterns: \\node_modules\\ - 25163 matches
Pattern: "" - 0 matches

在我的 package.json 文件中,我的 jest 配置如下所示:
"jest": {
"collectCoverageFrom": [
"app/**/*.{js,jsx}",
"!app/**/*.test.{js,jsx}",
"!app/*/RbGenerated*/*.{js,jsx}",
"!app/app.js"
],
"coverageThreshold": {
"global": {
"statements": 98,
"branches": 91,
"functions": 98,
"lines": 98
}
},
"moduleDirectories": [
"node_modules",
"app",
"common"
],
"moduleNameMapper": {
".*\\.(css|less|styl|scss|sass)$": "<rootDir>/internals/mocks/cssModule.js",
".*\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/internals/mocks/image.js"
},
"setupTestFrameworkScriptFile": "<rootDir>/internals/testing/test-bundler.js"
}

我正在使用节点 8.1.4 和 jest v20.0.4
关于如何开 Jest 找到我的测试的任何想法?

最佳答案

我不是 100% 确定它是同一个问题。但是对我来说解决它的是摆脱守望者(我将它添加到另一个使用中继的项目的路径中)。尝试使用 --no-watchman 运行(或在 jest 配置中设置 watchman: false )

关于jestjs - 如何在 Windows 10 上修复 Jest "No Tests Found"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45132566/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com