Skip to content

Having vitest.workspace.js causes vitest.config.* files to no longer be respected #689

@mogelbrod

Description

@mogelbrod

Describe the bug

Opening a vscode folder with a vitest.workspace.js file present appears to stop the include/exclude matching from working, and instead leads to every single *.spec.* file found being included in the Testing sidebar. As soon as I remove the vitest.workspace.js file the list behaves as expected, only including files that have been listed in vitest configs.

Reproduction

https://github.com/mogelbrod/vscode-vitest-bug

Output

[INFO 17:45:01] [v0.0.0] Vitest extension is activated because Vitest is installed or there is a Vite/Vitest config file in the workspace.
[INFO 17:45:01] [API] Resolving workspace configs: vitest.workspace.js
[INFO 17:45:01] [API] Running Vitest v4.0.14 (temp/vitest.workspace.js) with "/Users/victor/.asdf/shims/node /Users/victor/.vscode/extensions/vitest.explorer-1.32.1/dist/worker.js"
[INFO 17:45:01] [API] Resolving configs: nested/vitest.config.js
[INFO 17:45:01] [API] Running Vitest v4.0.14 (nested/vitest.config.js) with "/Users/victor/.asdf/shims/node /Users/victor/.vscode/extensions/vitest.explorer-1.32.1/dist/worker.js"
[INFO 17:45:02] [API] Watching vitest.workspace.js
[INFO 17:45:02] [VSCODE] Watching temp with pattern **/*
[INFO 17:45:02] [API] Watching nested/vitest.config.js
[17:45:03] [VSCODE] Ignoring file: .git/FETCH_HEAD
[17:45:03] [VSCODE] Ignoring file: nested/vitest.config.js.git

Extension Version

1.32.1

Vitest Version

4.0.14

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions