使用Web组件调试Jest测试

问题描述

我有一个基于Web组件(即lit-element)和TypeScript的Web应用程序。我的Jest测试在https://github.com/facebook-atom/jest-electron-runner下运行良好。 但是如何在WebStorm或VS Code中调试它们?在WebStorm中运行测试时,我得到以下输出

我正在使用Electron,因为jsdom缺少了大多数这些现代功能,例如适当的Web组件支持或指针事件。

/usr/local/bin/node --require /Applications/WebStorm.app/Contents/plugins/JavaScriptLanguage/helpers/jest-intellij/lib/jest-intellij-stdin-fix.js paint2/node_modules/jest/bin/jest.js --runInBand --colors --reporters /Applications/WebStorm.app/Contents/plugins/JavaScriptLanguage/helpers/jest-intellij/lib/jest-intellij-reporter.js --verbose "--testNamePattern=^paint-color-toolbar " --runTestsByPath src/components/color-toolbar/paint-color-toolbar.test.ts
Debugger listening on ws://127.0.0.1:62103/fc4ef788-f569-43ce-b83f-da1a0de57cfc
For help,see: https://nodejs.org/en/docs/inspector
Debugger attached.
Debugger listening on ws://127.0.0.1:62114/6e06a226-33f6-46af-b98d-a73b36cd3128
For help,see: https://nodejs.org/en/docs/inspector
Debugger attached.
Debugger listening on ws://127.0.0.1:62117/48f67c9b-96ee-47fb-bf8d-d4f2943cca14
For help,see: https://nodejs.org/en/docs/inspector
Debugger attached.

但是调试器不会停止。

有帮助的项目在这里。我正在尝试运行测试颜色工具栏:https://github.com/Waxolunist/paint2/blob/feature/no-babel/src/components/color-toolbar/paint-color-toolbar.test.ts

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)