首页 > 解决方案 > 量角器调试问题 - 等待调试器断开连接

问题描述

我正在尝试在 VSCode 上调试量角器脚本。

我编辑了 launch.json 文件,但调试控制台抛出以下错误。

这是 VSCode 调试控制台输出:

C:\Program Files\nodejs\node.exe --inspect-brk=45448 conf.js C:\Users\abc\AppData\Roaming\npm\node_modules\protractor\example/conf.js 

Debugger listening on ws://127.0.0.1:45448/ab61a2d7-4b40-456b-86cb-838e94dfe5b0

Debugger attached.

Waiting for the debugger to disconnect...

我也无法在网上的任何地方找到解决方案。

标签: node.jsvisual-studio-codeprotractorvscode-settingsvscode-debugger

解决方案


在 VSCode 中设置断点时,需要运行以下命令:

node --inspect-brk ./node_modules/.bin/protractor conf.js

上面的路径假定 Protractor 安装在node_modules/.bin/项目本地的目录中。

接下来导航到chrome://inspect。你将不得不跳过 Protractor 的入口点,然后你应该点击你的断点。确保您使用的是节点 8 以避免获得 polyfill-ed 承诺。

我们在ng-conf 视频中详细介绍了这一点。我们使用与上述等效的e2e-debug 命令的脚本开始测试。


推荐阅读