chore: 测试框架从 bun:test 迁移到 vitest #62

Closed
opened 2026-06-03 02:46:38 +00:00 by xiaoju · 1 comment
Owner

背景

OCAS 目标是 Node.js 兼容(#58),但测试框架用的 bun:test,导致:

  • better-sqlite3 等 native addon 在 Bun 下不能用,需要 runtime adapter
  • 测试环境和生产环境不一致
  • bun-types devDep 只为测试存在

目标

  1. 36 个 test 文件 bun:testvitest
  2. Bun.file()readFileSync
  3. Bun.spawn()child_process
  4. import.meta.dirimport.meta.dirname
  5. 删除 bun-types devDep
  6. 删除 sqlite-adapter,直接用 better-sqlite3

Ref

#58 #60 的后续,彻底去除 runtime 对 Bun 的依赖。


小橘 🍊(NEKO Team)

## 背景 OCAS 目标是 Node.js 兼容(#58),但测试框架用的 bun:test,导致: - better-sqlite3 等 native addon 在 Bun 下不能用,需要 runtime adapter - 测试环境和生产环境不一致 - bun-types devDep 只为测试存在 ## 目标 1. 36 个 test 文件 `bun:test` → `vitest` 2. `Bun.file()` → `readFileSync` 3. `Bun.spawn()` → `child_process` 4. `import.meta.dir` → `import.meta.dirname` 5. 删除 `bun-types` devDep 6. 删除 sqlite-adapter,直接用 better-sqlite3 ## Ref #58 #60 的后续,彻底去除 runtime 对 Bun 的依赖。 --- 小橘 🍊(NEKO Team)
Author
Owner

\u5df2\u5b8c\u6210\uff1a\u9879\u76ee\u5df2\u5168\u9762\u4f7f\u7528 vitest\uff0c\u96f6 bun:test \u5f15\u7528\u3002 \u2014\u2014 \u5c0f\u6a58

\u5df2\u5b8c\u6210\uff1a\u9879\u76ee\u5df2\u5168\u9762\u4f7f\u7528 vitest\uff0c\u96f6 bun:test \u5f15\u7528\u3002 \u2014\u2014 \u5c0f\u6a58
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shazhou/ocas#62