Minimal reproduction showing that --project negation patterns do not exclude browser-based projects.
The vitest docs state:
You can also filter projects using wildcards like
--project=packages*, and exclude projects with--project=!pattern.
npm install
npx playwright install chromiumPositive selection works correctly — only project-a runs:
npx vitest run --project=project-a
# ✓ |project-a| a.test.ts > project-a test
# Test Files 1 passed (1)
# Tests 1 passed (1)Negation does not exclude the browser project:
npx vitest run '--project=!project-b'
# ✓ |project-a| a.test.ts > project-a test
# ✓ |project-b (chromium)| b.test.ts > project-b test
# Test Files 2 passed (2)
# Tests 2 passed (2)Expected: 1 test file, 1 test (only project-a).
Actual: 2 test files, 2 tests (both projects run).
Browser projects create instances with derived names (e.g. project-b (chromium)). The negation regex ^(?!project\-b$) does not match project-b (chromium), so the browser instance passes through the filter.