Visual Studio Code debugging - Jest breakpoints not working as expected

痴心易碎 提交于 2020-01-13 18:24:07

问题


Recently I have upgraded to Jest 23.x.x, using the same VSCode debugging configuration as in Jest 22.x.x, I get weird behaviors: breakpoints are moved, and you cannot really debug (not hitting the real line of code). If I downgrade to 22 everything works as expected.

Is there any breaking change or update from 22 to 23 to be aware of for this case?

My vscode debug launch configuration

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

来源:https://stackoverflow.com/questions/52454412/visual-studio-code-debugging-jest-breakpoints-not-working-as-expected

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!