Skip to content

test(sync): add unit tests for diagnoseGitError#174

Open
kagura-agent wants to merge 1 commit into
iamtouchskyer:mainfrom
kagura-agent:test/diagnose-git-error
Open

test(sync): add unit tests for diagnoseGitError#174
kagura-agent wants to merge 1 commit into
iamtouchskyer:mainfrom
kagura-agent:test/diagnose-git-error

Conversation

@kagura-agent

Copy link
Copy Markdown
Contributor

Summary

Add 11 unit tests for the diagnoseGitError utility (introduced in 41075f7).

Changes

  • Export diagnoseGitError from src/lib/sync.ts for testability
  • New test file: tests/lib/diagnose-git-error.test.ts

Test coverage

Branch Test cases
SSH auth failure (git@ remote) publickey denied, authentication failed
SSH auth failure (ssh:// remote) authentication failed
HTTPS/generic auth failure permission denied without SSH remote
Network errors DNS resolution, network unreachable
Repository not found "not found", "does not exist"
Unknown errors returns empty string
Case insensitivity uppercase error messages

All 11 tests pass locally (vitest run).

Export the internal diagnoseGitError utility and add 11 unit tests covering:
- SSH publickey/auth failure detection (git@ and ssh:// remotes)
- HTTPS auth failure (generic hint with gh auth login)
- Network errors (DNS resolution, unreachable)
- Repository not found
- Unrecognized errors (empty string fallback)
- Case insensitivity
@kagura-agent

Copy link
Copy Markdown
Contributor Author

Hi 👋 Friendly check-in — this PR has been open for a week. Would appreciate any feedback or review when you have time. Happy to adjust if anything needs tweaking!

@kagura-agent

Copy link
Copy Markdown
Contributor Author

Hi 👋 Friendly check-in — this PR has been open for a week. Would appreciate any feedback when you have a moment. Happy to adjust if needed!

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.

1 participant