Skip to content

test: migrate from bun's test runner to Vitest (on the Bun runtime)#489

Merged
evantahler merged 1 commit into
mainfrom
irvine-v6
Jun 17, 2026
Merged

test: migrate from bun's test runner to Vitest (on the Bun runtime)#489
evantahler merged 1 commit into
mainfrom
irvine-v6

Conversation

@evantahler

Copy link
Copy Markdown
Member

Replaces bun test with Vitest running on the Bun runtime (bunx --bun vitest) across every workspace — the app and runtime stay on Bun, only the test runner changes, for better reporting and CI ergonomics. All ~89 test files and the keryx/testing helpers now import from "vitest", each workspace gets a vitest.config.ts (forks pool, serial files, zod inlined), the [test]-only bunfig.toml files are removed, and CI uses native --shard. Two non-obvious fixes were required to run under Vite's transformer: swapping Bun-only import.meta.dir/.path for the standard import.meta.dirname/.filename (Vite doesn't populate the Bun variants, which crashed api.start()), and inlining zod so its named exports resolve; non-core matchers and the removed test(name, fn, {options}) signature were also converted. The generator/scaffold now wires Vitest into generated apps, docs/CLAUDE.md are updated, and vitest is added as an optional peer/dev dep of keryx (bumped to 0.31.0). Verified green on Bun + Vitest 4.1.9: keryx 777 tests, example/backend 245 (+10 benchmarks), plugins 37, frontend 1, docs 24, plus bun lint/bun format clean and an end-to-end generated-app test.

🤖 Generated with Claude Code

Run tests with Vitest executing on Bun (`bunx --bun vitest`) instead of
`bun test`. The app/runtime stays on Bun; only the test runner changes.

- Migrate all test files + keryx/testing helpers from "bun:test" to "vitest"
- Add vitest.config.ts per workspace (forks pool, serial files, zod inlined);
  delete the [test]-only bunfig.toml files
- Replace Bun-only import.meta.dir/.path with standard import.meta.dirname/
  .filename (Vite doesn't populate the Bun variants)
- Convert non-core matchers (toInclude/toBeArray/toBeEmpty/toStartWith/
  toBeFunction) and the removed test(name, fn, {options}) signature
- Update scripts, CI sharding (--shard), generator + scaffold, and docs
- Add vitest as an optional peer/dev dep of keryx; bump keryx to 0.31.0

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@evantahler evantahler merged commit b90e6ab into main Jun 17, 2026
15 checks passed
@evantahler evantahler deleted the irvine-v6 branch June 17, 2026 06:17
@evantahler evantahler restored the irvine-v6 branch June 18, 2026 04:09
@evantahler evantahler deleted the irvine-v6 branch June 18, 2026 04:09
evantahler added a commit that referenced this pull request Jun 18, 2026
This reverts commit b90e6ab.

Restores Bun's built-in test runner (`bun test`) across all workspaces:
- Revert all *.test.ts and keryx/testing imports back to "bun:test"
- Restore [test] bunfig.toml files; delete vitest.config.ts files
- Revert package.json/root test scripts and CI sharding to bun test
- Restore import.meta.dir in .conductor/setup.ts; drop vitest dep
- Bump keryx 0.31.1 -> 0.32.0

Conflicts (resolved): .conductor/setup.ts, CLAUDE.md,
packages/keryx/package.json -- all touched by #490 after #489.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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