【发布时间】:2021-04-09 15:32:57
【问题描述】:
我想使用 vs-code 在调试模式下运行 Typescript spec.ts。
通常,我从终端窗口运行它,如下所示:
npm run test:unit -- page.spec.ts
我添加了console.log 语句来识别值。有没有办法在 vs-code 中做到这一点?
当这个 npm 命令在终端上运行时,我看到正在执行的是 package.json 中的一个脚本
"test:unit": "ngcc && jest --coverage --ci --config=jest.conf.json"
因此,我不清楚如何将其设置为在调试模式下运行。
我读过的所有帖子都使用mocha 或正在browser 中运行测试。这些是简单的单元测试,我想加入和退出。
不胜感激任何提示/建议。
【问题讨论】:
-
设置起来并不容易,但我认为这个链接可能会让你朝着正确的方向前进:code.visualstudio.com/docs/typescript/typescript-debugging
标签: typescript unit-testing visual-studio-code