美文网首页
jest vscode 断点调试

jest vscode 断点调试

作者: 朱小维 | 来源:发表于2022-03-26 08:37 被阅读0次

launch.json

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Jest All",
            "program": "${workspaceFolder}/node_modules/.bin/jest",
            "args": ["--runInBand"],
            "console": "integratedTerminal",
            "internalConsoleOptions": "neverOpen",
            "disableOptimisticBPs": true,
            "windows": {
              "program": "${workspaceFolder}/node_modules/jest/bin/jest",
            }
          },
          {
            "type": "node",
            "request": "launch",
            "name": "Jest Current File",
            "program": "${workspaceFolder}/node_modules/.bin/jest",
            "args": [
              "${fileBasenameNoExtension}",
              "--config",
              "jest.config.js"
            ],
            "console": "integratedTerminal",
            "internalConsoleOptions": "neverOpen",
            "disableOptimisticBPs": true,
            "windows": {
              "program": "${workspaceFolder}/node_modules/jest/bin/jest",
            }
          }
    ]
}

参考:
1.https://github.com/microsoft/vscode-recipes/tree/master/debugging-jest-tests
2.https://segmentfault.com/a/1190000020419325

相关文章

网友评论

      本文标题:jest vscode 断点调试

      本文链接:https://www.haomeiwen.com/subject/azvjjrtx.html