claude-code-best
|
43af260322
|
test: 添加 json/truncate/path/tokens 模块测试
- json.test.ts: 27 tests (safeParseJSON, safeParseJSONC, parseJSONL, addItemToJSONCArray)
- truncate.test.ts: 24 tests (truncateToWidth, truncateStartToWidth, truncatePathMiddle, truncate, wrapText)
- path.test.ts: 15 tests (containsPathTraversal, normalizePathForConfigKey)
- tokens.test.ts: 22 tests (getTokenCountFromUsage, getTokenUsage, tokenCountFromLastAPIResponse, etc.)
使用 mock.module() 切断 log.ts/tokenEstimation.ts/slowOperations.ts 重依赖链
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
2026-04-01 23:56:37 +08:00 |
|