VS代码调试器变量未显示

时间:2020-06-11 18:41:39

标签: jestjs vscode-settings

我正在尝试在vscode中调试测试。 开玩笑是赛跑者。 这是我的启动配置。

{
    "version": "0.2.0",
    "configurations": [
      {
        "type": "node",
        "request": "launch",
        "name": "Jest All",
        "program": "${workspaceFolder}/node_modules/jest/bin/jest",
        "args": ["--runInBand"],
        "console": "integratedTerminal",
        "internalConsoleOptions": "neverOpen",
        "sourceMaps": true      }
    ]
  }

在启动调试器时使用它,它会在断点处停止,但是任何变量都不会显示在本地变量窗格中。 image

1 个答案:

答案 0 :(得分:-1)

尝试此操作(如果u在Windows上):

{
    "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",
        }
      }
    ]
  }