refactor: migrate test runner from vitest to bun:test

- Replace vitest with bun:test across all 8 packages (47 test files)
- vi.spyOn → spyOn, vi.restoreAllMocks() → mock.restore() (3 files)
- toHaveBeenCalledOnce → toHaveBeenCalledTimes(1) (bun:test compat)
- Delete all vitest.config.ts files
- Remove vitest from devDependencies
- Add preload.ts for process.exit mock (cli-workflow)
- Fix import ordering (biome check --write)

All tests pass. Closes #601
This commit is contained in:
2026-06-02 18:55:17 +08:00
parent 008701ef46
commit e65e2aec72
68 changed files with 116 additions and 197 deletions
+3 -5
View File
@@ -6,8 +6,8 @@
"scripts": {
"dev": "bun server.ts",
"build": "vite build",
"test": "vitest run",
"test:ci": "vitest run"
"test": "bun test src/",
"test:ci": "bun test src/"
},
"dependencies": {
"@base-ui/react": "^1.5.0",
@@ -33,10 +33,8 @@
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^6.0.2",
"@vitest/ui": "^4.1.7",
"tailwindcss": "^4.2.4",
"typescript": "^5.8.3",
"vite": "^8.0.13",
"vitest": "^4.1.7"
"vite": "^8.0.13"
}
}