2

我試圖在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

回答

2

你可以試試下面的配置,使您的調試在VS代碼工作。在outFiles中給出您的功能文件路徑。

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