mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-06 16:31:08 +00:00
test: add 178 tests for credential display, auth parsing, and internal helpers (#1063)
Adds comprehensive test coverage for previously untested or weakly tested areas in commands.ts and index.ts: - formatCredStatusLine: newly exported function with zero prior tests - formatAuthVarLine (replicated): private helper for quick-start display - groupByType (replicated): private helper for clouds/agents grouping - formatCacheAge (replicated): version display cache age formatting - parseAuthEnvVars: 14 edge cases (CloudSigma format, short strings, hyphens) - hasCloudCredentials: 8 edge cases (empty values, multiple vars, none auth) - getImplementedClouds/getImplementedAgents: nonexistent/empty manifest cases - getMissingClouds: all/none/empty scenarios - calculateColumnWidth: boundary and empty array cases - prioritizeCloudsByCredentials/buildAgentPickerHints: empty/orphan agents - resolveDisplayName: null manifest, unknown keys - buildRecordLabel/buildRecordHint: null manifest, long prompts - formatRelativeTime/formatTimestamp: all time buckets + invalid input - getErrorMessage: null, undefined, boolean, object-without-message - levenshtein: empty strings, symmetry, insertions/deletions - findClosestMatch/findClosestKeyByNameOrKey: empty candidates, case sensitivity - resolveAgentKey/resolveCloudKey: display name resolution, empty string - checkEntity: swapped kind detection (agent as cloud, cloud as agent) - getStatusDescription: 404 vs other HTTP codes - isRetryableExitCode: all exit codes including empty/signal messages - buildRetryCommand: prompt length boundary (80 vs 81 chars), quote escaping - credentialHints: all-set, missing, custom verb - getSignalGuidance: all signals + dashboard URL - getScriptFailureGuidance: all exit codes + null + dashboard Agent: test-engineer Co-authored-by: A <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
5b0358bcd1
commit
04e92fe727
1 changed files with 1211 additions and 0 deletions
1211
cli/src/__tests__/commands-credential-display-internals.test.ts
Normal file
1211
cli/src/__tests__/commands-credential-display-internals.test.ts
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue