WebStorm - 调试 Jest 测试 - 命中断点前的异常时间
WebStorm - debugging a Jest test - abnormal amount of time before the breakpoint is hit
我已经设置好 typescript + jest(带 ts-loader)。
在此示例测试(项目中唯一的测试)中设置断点需要几分钟时间。这只发生在 WebStorm 中。在 VSCode 中使用此配置
"configurations": [
{
"name": "Debug Jest Tests",
"type": "node",
"request": "launch",
"args": [
"${workspaceRoot}/node_modules/jest/bin/jest.js",
"--runInBand"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
}
]
几乎是瞬间。
在 CRA 环境中调试 Jest 测试工作正常,即使在 WebStorm 中也是如此。
测试:
describe('Stuff', function () {
it('should', function () {
expect(true).toBe(true); // breakpoint
});
});
回购:
https://github.com/vlopp/jest-webstorm-testing
请告诉我哪里出了问题,以及如何最大限度地减少 WebStorm 调试测试所花费的异常时间。
更新
扔掉 ts-jest 似乎并不能解决问题。
这是启用JavaScript异常断点的已知问题,请关注WEB-28989更新
我已经设置好 typescript + jest(带 ts-loader)。
在此示例测试(项目中唯一的测试)中设置断点需要几分钟时间。这只发生在 WebStorm 中。在 VSCode 中使用此配置
"configurations": [
{
"name": "Debug Jest Tests",
"type": "node",
"request": "launch",
"args": [
"${workspaceRoot}/node_modules/jest/bin/jest.js",
"--runInBand"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
}
]
几乎是瞬间。
在 CRA 环境中调试 Jest 测试工作正常,即使在 WebStorm 中也是如此。
测试:
describe('Stuff', function () {
it('should', function () {
expect(true).toBe(true); // breakpoint
});
});
回购: https://github.com/vlopp/jest-webstorm-testing
请告诉我哪里出了问题,以及如何最大限度地减少 WebStorm 调试测试所花费的异常时间。
更新
扔掉 ts-jest 似乎并不能解决问题。
这是启用JavaScript异常断点的已知问题,请关注WEB-28989更新