Skip to content

Copy Error and Copy Test Errors appear on non-Vitest test results #774

Description

@alexchexes

Describe the bug

Copy Error / Copy Test Errors actions appear on non-Vitest test results.

Clicking them on another controller's results is a no-op or can show unrelated Vitest warnings.

Vitest-specific copy actions seem to leak into foreign Testing controllers/results.

Image

Expected behavior

Those actions should only appear for Vitest-owned results/messages.

Likely fix: add proper when scoping to the result/message menu contributions.

Reproduction

  1. Install Vitest VS Code extension and another Testing extension, for cleaner repro I use AlexChexes.tmgrammar-test-tools-vscode which works on unsaved files.
  2. Open a new VS Code window without any Vitest project or test files.
  3. Open a new tab with a trivial test, for example:
// SYNTAX TEST "source.js"
foo = 42
//    ^^ constant.numeric.decimal.js
  1. Run the test from the non-Vitest extension.
  2. Open the Test Results view.
  3. Observe that Vitest adds Copy Error / Copy Test Errors to foreign result/message items.

Output

No Vitest Output channel was created in this reproduction.
The issue reproduces in a new no-workspace window before any Vitest project/runtime is active.

Extension Version

1.50.1

Vitest Version

N/A (no workspace/project/test files/any files in repro)

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions