Skip to content

fix(ci): fix vitest config for v4 and use correct test runner#2159

Merged
koistya merged 2 commits into
mainfrom
dev
Feb 15, 2026
Merged

fix(ci): fix vitest config for v4 and use correct test runner#2159
koistya merged 2 commits into
mainfrom
dev

Conversation

@koistya

@koistya koistya commented Feb 15, 2026

Copy link
Copy Markdown
Member

Problem

Two issues causing CI tests to silently run in the wrong environment:

  1. bun testbun run testbun test invokes Bun's built-in test runner, not the "test": "vitest" script from package.json. Bun's runner ignores all vitest config (environment, plugins, etc.).

  2. vitest.workspace.ts silently ignored — The workspace file was removed in Vitest 4 in favor of test.projects in the root config. With the file ignored, vitest fell back to the root config which had no environment: "happy-dom", so DOM-dependent tests would fail.

Changes

File Change Why
ci.yml bun testbun run test -- --run Run vitest (not Bun's runner); --run disables watch mode
vitest.config.ts Add test.projects: ["apps/*"] Vitest 4 API for project discovery — each app's vite.config.ts provides its own environment, plugins, etc.
vitest.workspace.ts Deleted Deprecated since Vitest 3.2, removed in v4

Before / After

// vitest.config.ts (before)
export default defineConfig({
  cacheDir: "./.cache/vite",
});

// vitest.config.ts (after)
export default defineConfig({
  cacheDir: "./.cache/vite",
  test: {
    projects: ["apps/*"],
  },
});

…ojects API

`bun test` invokes Bun's built-in test runner, not the `"test": "vitest"`
script — completely bypassing vitest config (environment, plugins, etc.).

`vitest.workspace.ts` was silently ignored since vitest 4 removed the
workspace file in favor of `test.projects` in the root config. Tests
were falling back to the root config with no `environment: "happy-dom"`.
Move sponsors below highlights so the value proposition comes first.
Remove duplicate AI assistant mention from description (already in
badges and "Need Help?" section).
@koistya koistya merged commit e2118ac into main Feb 15, 2026
8 checks passed
@koistya koistya deleted the dev branch February 15, 2026 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant