我试图在VS代码中的“捕获异常”处调试Jest测试和断点,但是它停在与我无关的/.node/corepack/yarn/1.22.15/lib/cli.js上。
我尝试在skipFiles中添加几个launch.json路径,但到目前为止还没有成功。
如何忽略Yarn/节点核心文件?

Launch.json
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"name": "vscode-jest-tests.v2",
"request": "launch",
"runtimeExecutable": "yarn",
"runtimeVersion": "16.13.2",
"program": "jest",
"args": [
"--runInBand",
"--watchAll=false",
"--testNamePattern",
"${jest.testNamePattern}",
"--runTestsByPath",
"${jest.testFile}"
],
"cwd": "${workspaceFolder}/next/",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"windows": {
"program": "jest"
},
"skipFiles": [
"<node_internals>/**/*.js",
"~/.node/**/*.js",
"**/.yarn/**",
"**/node_modules/**",
"**/yarn/**",
]
},
]
}发布于 2022-10-11 17:22:37
添加**/.node/corepack/yarn/**使它忽略了这些文件。
"skipFiles": [
"<node_internals>/**",
"**/node_modules/**",
"**/.node/corepack/yarn/**"
]https://stackoverflow.com/questions/74031776
复制相似问题