test: migrate from bun's test runner to Vitest (on the Bun runtime)#489
Merged
Conversation
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
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces
bun testwith 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 thekeryx/testinghelpers now import from"vitest", each workspace gets avitest.config.ts(forks pool, serial files, zod inlined), the[test]-onlybunfig.tomlfiles are removed, and CI uses native--shard. Two non-obvious fixes were required to run under Vite's transformer: swapping Bun-onlyimport.meta.dir/.pathfor the standardimport.meta.dirname/.filename(Vite doesn't populate the Bun variants, which crashedapi.start()), and inliningzodso its named exports resolve; non-core matchers and the removedtest(name, fn, {options})signature were also converted. The generator/scaffold now wires Vitest into generated apps, docs/CLAUDE.md are updated, andvitestis added as an optional peer/dev dep ofkeryx(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, plusbun lint/bun formatclean and an end-to-end generated-app test.🤖 Generated with Claude Code