reactjs - 防止 vscode jest 扩展将 cypress 测试解释为 jest 测试
问题描述
我有一个带有 jest(in ./src/components)
和 cypress(in ./cypress)
测试的 create-react-app 项目。我的package.json
文件中有单独的命令来运行两个测试套件,并且一切都按预期工作。
我的问题在于vscode
开玩笑扩展 ( orta.vscode-jest
),它将我的cypress
测试解释为开玩笑测试并尝试运行它们。
解决方案
我通过在我的文件中添加一行来解决这个问题.vscode/settings.json
,告诉vscode
jest 扩展名 ( orta.vscode-jest
) 使用正确的 jest 命令
{
"jest.pathToJest": "npm run test:jest --"
}
命令在test:jest
my 中定义的位置package.json
:
{
"scripts: {
"test:jest": "CI=true react-scripts test",
}
}
推荐阅读
- kibana - 日期间隔可视化 Kibana
- opencv - 填充并增加图像区域以适应扩张输出 | 开放式简历 | Python
- c++ - VS Code '无法打开源文件 "stdio.h" C/C++'
- javascript - 如何仅在 VueJS 中的 API 初始加载后观看?
- python - 为什么 cv2.aruco.detectMarkers() 中 Charucos 的检测率这么差?
- c - 为什么这个静态函数的输出是 18?
- android - 奖励广告在 Android 中无法正常工作
- reactjs - 样式组件(styled-components) | 将一个叠加在另一个之上
- javascript - 如果在 Laravel 中验证失败,则保持模式打开
- github-actions - 如何解决cloudformation yaml将在一行中聚合的问题