feat: 搭建单元测试基础设施 — Bun test runner + 示例测试

添加 bunfig.toml 配置、test script,以及三组示例测试:
- src/utils/array.ts (intersperse, count, uniq)
- src/utils/set.ts (difference, intersects, every, union)
- packages/color-diff-napi (ansi256FromRgb, colorToEscape, detectLanguage 等)

41 tests, 0 failures.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
claude-code-best
2026-04-01 02:08:38 +08:00
parent 9dd1eeff2f
commit e443a8fa51
6 changed files with 229 additions and 2 deletions

View File

@@ -16,7 +16,8 @@
"lint": "biome check src/",
"lint:fix": "biome check --fix src/",
"format": "biome format --write src/",
"prepare": "git config core.hooksPath .githooks"
"prepare": "git config core.hooksPath .githooks",
"test": "bun test"
},
"dependencies": {
"@alcalzone/ansi-tokenize": "^0.3.0",