vitest-dev / vscode

VS Code extension for Vitest
https://vitest.dev/vscode
MIT License
755 stars 85 forks source link

Exclude option is ignored #264

Closed luixo closed 7 months ago

luixo commented 8 months ago

Describe the bug In my tests explorer I see files that I explicitely exclude in vitest.config.ts (they're a part of Playwright tests).

To Reproduce Steps to reproduce the behavior on the example project:

  1. Create vitest.config.ts:
    
    import { configDefaults, defineConfig } from "vitest/config";

export default defineConfig({ test: { // ... exclude: [ ...configDefaults.exclude, "*/.test.ts", "*/.spec.ts", ], }, });


1. Add `foo.test.ts` and `foo.spec.ts` to a src dir
1. Run `vitest` - witness only `foo.test.ts` test being run
1. Open extension
1. `foo.spec.ts` is there

**Expected behavior**
Files, ignored by `exclude` should not be visible in test explorer

**Screenshots**
A live example from my project:
<img width="638" alt="Снимок экрана 2024-02-24 в 04 14 57" src="https://github.com/vitest-dev/vscode/assets/1051134/e2803f52-02ce-4cb7-88a5-06c05fd0398c">
<img width="498" alt="Снимок экрана 2024-02-24 в 04 15 16" src="https://github.com/vitest-dev/vscode/assets/1051134/bc7aee07-4cd3-4e81-9bc1-140aec5d6861">

**Environment**

(Paste info.txt content generated by [the example project](https://github.com/zxch3n/vitest-ext-basic-example))

- OS: macOS
- VSCode version: 1.86.2 (Universal)
- Vitest version: 1.2.2
- Vitest plugin version: 0.4.0

**Additional context**
Could be related: https://github.com/vitest-dev/vscode/issues/215, https://github.com/vitest-dev/vscode/issues/60, https://github.com/vitest-dev/vscode/issues/96.
sheremet-va commented 7 months ago

This is fixed in pre-release 0.5.0 and higher. Note that the extension now requires Vitest 1.4.0 or higher.