繁体   English   中英

你如何通过使用 vscode 进行调试来启动 oclif 测试?

[英]how do you launch oclif tests with debugging using vscode?

在调试模式下运行 oclif 项目测试的 launch.json 是什么样的? 我似乎无法理解,所以我设置了断点并介入。

这个 launch.json 配置对我有用:

{
  "type": "node",
  "request": "launch",
  "name": "Mocha Tests",
  "runtimeExecutable": "${workspaceFolder}/node_modules/ts-mocha/bin/ts-mocha",
  "args": [
    "${workspaceFolder}/test/**/*.ts"
  ],
  "protocol": "inspector"
},

我从这里提供的回复中受益: https : //github.com/oclif/oclif/issues/135#issuecomment-403622999

我用打字稿测试过它, program非常适合调试。

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "request": "launch",
      "name": "Launch Program",
      "program": "${workspaceFolder}/bin/run",
      "args": [
        "--name",
        "Callum",
        "--force",
        "argument"
      ]
    }
  ]
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM