{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:9876",
"webRoot": "${workspaceFolder}"
}
]
}
1 回答
打开调试选项卡
添加Chrome配置,它会为您填写大部分字段 . 对于端口,将其更改为
9876
(或karma.conf.js
中指定的任何内容) . 见下文 .在要调试的代码中设置断点
运行调试任务,该任务将打开指向端口的chrome窗口
运行测试命令(
ng test
)并根据需要刷新打开的Chrome窗口样本配置,它们是在名为
launch.json
的字段中创建的