如何在Visual Studio代码(VSCode)中调试Cucumber?

问题描述:

我试图在Visual Studio代码调试黄瓜场景,并在launch.json变化下面进行。如何在Visual Studio代码(VSCode)中调试Cucumber?

{ 
      "name": "e2e", 
      "type": "node", 
      "request": "launch", 
      "program": "${workspaceRoot}\\node_modules\\.bin\\cucumber-js", 
      "stopOnEntry": false, 
      "args": ["--no-timeouts", "--colors"], 
      "cwd": "${workspaceRoot}", 
      "runtimeExecutable": null, 
      "outFiles": [ 
       "${workspaceRoot}\\features\\step_definitions\\*.js" 
      ] 
}, 

但是,我不能使用上述配置运行调试会话。步骤def。我用JavaScript创建的文件。 所以,只需要上面的脚本的帮助,如果看起来不错?

+0

什么断点?哪里? – ifconfig

+0

断点在代码中的某处!上面的问题是验证我的配置。在'launch.json'中用于黄瓜的脚本。希望你现在很清楚.. – user7890278

你可以试试下面的配置,使您的调试在VS代码工作。在outFiles中给出您的功能文件路径。

{ 
    "name": "e2e", 
    "type": "node", 
    "request": "launch", 
    "program": "${workspaceRoot}/node_modules/cucumber/bin/cucumber.js", 
    "outFiles": [ 
     "${workspaceRoot}/features/*.feature" 
    ] 
}