[pull] main from claude-code-best:main#5
Merged
Conversation
覆盖 buildTool、toolMatchesName、findToolByName、getEmptyToolPermissionContext、 filterToolProgressMessages、parseToolPreset、parseGitCommitId、detectGitOperation 共 46 个测试用例全部通过。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
覆盖 xml, hash, stringUtils, semver, uuid, format, frontmatterParser, file, glob, diff 共 10 个模块的纯函数测试。 json.ts 因模块加载链路过重暂跳过。 共 190 个测试用例(含已有 array/set)全部通过。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
覆盖 stripHtmlComments、isMemoryFilePath、getLargeMemoryFiles、 buildEffectiveSystemPrompt 等函数,共 25 个测试用例全部通过。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
覆盖 escapeRuleContent、unescapeRuleContent、permissionRuleValueFromString、 permissionRuleValueToString、normalizeLegacyToolName,共 25 个测试用例。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
覆盖 isModelAlias、isModelFamilyAlias、getAPIProvider、 isFirstPartyAnthropicBaseUrl、firstPartyNameToCanonical,共 40 个测试用例。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
覆盖 parseCronExpression、computeNextCronRun、cronToHuman, 包含有效/无效表达式、字段范围验证、下次运行计算、人类可读描述, 共 38 个测试用例。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
为 normalizeGitRemoteUrl 添加 18 个测试用例,覆盖 SSH、HTTPS、 ssh://、CCR 代理 URL 格式、大小写规范化及边界条件。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
为 SettingsSchema、PermissionsSchema、AllowedMcpServerEntrySchema 验证,MCP 类型守卫,设置常量函数,以及 validation 工具函数添加 62 个测试用例。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
为消息创建、查询、文本提取、规范化等函数添加 56 个测试用例, 覆盖 createAssistantMessage、createUserMessage、isSyntheticMessage、 extractTag、isNotEmptyMessage、normalizeMessages 等核心功能。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
在 testing-spec.md 新增第 11 节,按 P0/P1/P2 分类记录 25 个 测试文件的覆盖范围、测试数量及已知的重依赖限制。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 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>
- FileEditTool/utils.test.ts: 24 tests (normalizeQuotes, stripTrailingWhitespace, findActualString, preserveQuoteStyle, applyEditToFile) - permissions/permissions.test.ts: 13 tests (getDenyRuleForTool, getAskRuleForTool, getDenyRuleForAgent, filterDeniedAgents) - tools.test.ts: 扩展 5 tests (filterToolsByDenyRules 过滤逻辑) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 新增 json/truncate/path/tokens/FileEditTool/permissions 测试记录 - 更新已知限制(Bun.JSONL bug, spawnMultiAgent 重依赖) - 添加 Mock 策略总结章节 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4 个阶段共计 ~213 tests / 20 files,目标从 647 提升至 ~860 tests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Test/test most core func
- errors.test.ts: 28 tests (isAbortError, toError, errorMessage, getErrnoCode, isFsInaccessible, classifyAxiosError 等) - shellRuleMatching.test.ts: 22 tests (permissionRuleExtractPrefix, hasWildcards, matchWildcardPattern, parsePermissionRule 等) - argumentSubstitution.test.ts: 18 tests (parseArguments, parseArgumentNames, generateProgressiveArgumentHint, substituteArguments) - CircularBuffer.test.ts: 12 tests (add, addAll, getRecent, toArray, clear, length) - sanitization.test.ts: 14 tests (partiallySanitizeUnicode, recursivelySanitizeUnicode) - slashCommandParsing.test.ts: 8 tests (parseSlashCommand) - contentArray.test.ts: 6 tests (insertBlockAfterToolResults) - objectGroupBy.test.ts: 5 tests (objectGroupBy) 总计:781 tests / 40 files Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Phase 2 (轻 Mock): envUtils, sleep/sequential, memoize, groupToolUses, dangerousPatterns, outputLimits Phase 3 (补全): zodToJsonSchema, PermissionMode, envValidation Phase 4 (工具模块): mcpStringUtils, destructiveCommandWarning, commandSemantics Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 删除 cli.tsx 顶部的 globalThis.MACRO / BUILD_* / feature polyfill - 新增 scripts/defines.ts 作为 MACRO define 映射的单一来源 - 新增 scripts/dev.ts,通过 bun run -d 在转译时注入 MACRO 常量 - build.ts 引用 getMacroDefines() 实现构建时内联 - 清理 global.d.ts (移除 BUILD_*, MACRO 函数声明) - 55 个 MACRO 消费文件零改动 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
新增覆盖: effort, tokenBudget, displayTags, taggedId, controlMessageCompat, MCP normalization/envExpansion, gitConfigParser, formatBriefTimestamp, hyperlink, windowsPaths, notebook Co-Authored-By: Claude Opus 4.6 <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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )