【问题标题】:Visual Studio Code: problemMatcher output remains there after the issue is fixedVisual Studio Code:问题修复后,problemMatcher 输出仍然存在
【发布时间】:2017-08-17 06:58:26
【问题描述】:

我有一个 npm 任务,我在其中观察我的 TypeScript 应用程序的更改、编译它然后自动运行测试。每当测试失败时,我都会尝试让 Visual Studio Code 在“问题”选项卡中向我发出警告。

虽然我设法实现了这一点,但每当我修复代码以使测试再次通过时,警告仍会保留在“问题”选项卡中。这很烦人,因为我会得到很多误报,而且我可能会忽略实际的测试失败。我想知道是否有办法在每次执行我的测试时刷新问题选项卡的内容?

这是我的 tasks.json 文件:

{
    "version": "0.1.0",
    "command": "npm",
    "isShellCommand": true,
    "showOutput": "silent",
    "suppressTaskName": true,
    "tasks": [
        {
            "taskName": "start",
            "args": ["start"],
            "isBackground": true,
            "problemMatcher": {
                "fileLocation": ["relative", "${workspaceRoot}"],
                "pattern": [
                    // Omitted for brevity
                ],
                "watching": {
                    "activeOnStart": true,
                    "beginsPattern": "\\[1\\] Starting 'test'\\.\\.\\.",
                    "endsPattern": ".*Finished 'test' after.*"
                }
            }
        }
    ]
}

谢谢!

【问题讨论】:

    标签: unit-testing typescript visual-studio-code


    【解决方案1】:

    虽然这不能直接回答我的问题,但我会分享这个以防有人偶然发现同样的问题。

    目前我正在使用node-tdd,由于其对 Windows 的支持有限,因此设置起来有点困难,但它似乎很符合要求。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-02-02
      • 1970-01-01
      • 2022-01-07
      • 1970-01-01
      • 2019-10-24
      • 1970-01-01
      • 2019-05-05
      相关资源
      最近更新 更多