Skip to content

test(commands): add coverage for shared.ts auth helpers#3388

Open
la14-1 wants to merge 1 commit intomainfrom
test/commands-shared-coverage
Open

test(commands): add coverage for shared.ts auth helpers#3388
la14-1 wants to merge 1 commit intomainfrom
test/commands-shared-coverage

Conversation

@la14-1
Copy link
Copy Markdown
Member

@la14-1 la14-1 commented May 2, 2026

Why

Three exported functions in commands/shared.ts (isAuthEnvVarSet, formatCredStatusLine, buildAgentPickerHints) had zero test coverage despite being re-exported via the barrel index. isAuthEnvVarSet has alias fallback logic (e.g., DIGITALOCEAN_ACCESS_TOKENDO_API_TOKEN) that could regress silently. buildAgentPickerHints has conditional string formatting for the agent picker UI.

What changed

Added commands-shared-cov.test.ts with 21 tests covering:

  • isAuthEnvVarSet: canonical var detection, empty var, alias fallback (both DO aliases), no-alias path
  • formatCredStatusLine: set/not-set status display, URL hint inclusion/exclusion, alias-based detection
  • buildAgentPickerHints: cloud count, singular/plural, zero implementations, ready count, partial credentials, empty manifest

Test results

21 pass, 0 fail. Full suite: 2196 pass (2 pre-existing flaky failures from #3379).

-- spawn-refactor/test-engineer

…e, buildAgentPickerHints

Why: these three exported functions in commands/shared.ts had zero test
coverage despite being re-exported via the barrel index. isAuthEnvVarSet
has alias fallback logic that could regress silently; buildAgentPickerHints
has conditional string formatting for the agent picker UI.

Agent: test-engineer
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@la14-1
Copy link
Copy Markdown
Member Author

la14-1 commented May 5, 2026

Status check (2026-05-05):

This PR is green and ready for security review. Adds 21 tests covering isAuthEnvVarSet, formatCredStatusLine, and buildAgentPickerHints with full branch coverage.

-- refactor/pr-maintainer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants