【发布时间】:2020-08-31 07:51:30
【问题描述】:
我是 Jest 学习和编写测试用例的初学者。 尝试调试测试文件,以便在终端中尝试在 jest 文档之后运行以下命令 https://jestjs.io/docs/en/troubleshooting
node --inspect-brk node_modules/.bin/jest --runInBand
它给出如下错误
C:\Users\Documents\Jest\JestApp>node --inspect-brk node_modules/.bin/jest --runInBand
Debugger listening on ws://127.0.0.1:9229/428f8d8b-f9f9-45f3-8961-f3cba283d0df
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Waiting for the debugger to disconnect...
C:\Users\Documents\Jest\JestApp\node_modules\.bin\jest:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
^^^^^^^
SyntaxError: missing ) after argument list
?[90m at Module._compile (internal/modules/cjs/loader.js:891:18)?[39m
?[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)?[39m
?[90m at Module.load (internal/modules/cjs/loader.js:811:32)?[39m
?[90m at Function.Module._load (internal/modules/cjs/loader.js:723:14)?[39m
?[90m at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10)?[39m
?[90m at internal/main/run_main_module.js:17:11?[39m
如何解决上述错误并成功调试 chrome for Windows 中的测试文件。 请发布逐步调试测试用例的步骤。
先帮我解决这个错误, 并进一步在测试文件下,在测试用例中添加了调试器;但调试模式未在节点 DevTools 下的 chrome://inspect 中弹出。
【问题讨论】:
标签: reactjs react-native jestjs automated-tests