test: improve code coverage with unit and integration tests#100
Merged
Conversation
Add 107 new tests raising overall coverage from 82.85% to 89.54% lines. Unit tests cover: auth polling, signup requests, session-context reading, binary-upgrade fetching, git helpers, plugin-install URLs, vscode settings, and command handler execution for adr/clean/list/show/update. Integration tests exercise the real CLI via Bun.spawn against isolated temp directories, covering init (all editors, idempotency, gitignore, linter overrides), check (pass/fail, --json, --ci, --adr, --verbose), adr CRUD (create/list/show/update with all flags), clean, and review-context (with git state, --domain, --run-checks).
Deploying archgate-cli with
|
| Latest commit: |
e89fa5c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://0d580a19.archgate-cli.pages.dev |
| Branch Preview URL: | https://test-improve-coverage.archgate-cli.pages.dev |
os.homedir() caches its result on Linux and doesn't pick up runtime HOME env var changes. Use unique fixture dirs under the actual homedir instead of overriding HOME.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
tests/integration/) that exercises the real CLI end-to-end viaBun.spawnagainst isolated temp directoriesUnit tests added
auth.tspollForAccessToken(pending/slow_down/expired/denied/deadline),claimArchgateTokenerror paths,getGitHubUsermissing loginsignup.tsrequestSignupsuccess/failure/default-editorsession-context.tsbinary-upgrade.tsfetchLatestGitHubVersion,downloadReleaseBinaryerror,replaceBinaryon non-Windowsgit.tsinstallGit(already-installed path)plugin-install.tsbuildVscodeMarketplaceUrl,isCopilotCliAvailablevscode-settings.tsgetVscodeUserSettingsPathplatform branchesadr list/show/create/update,clean— actual execution with temp projectsIntegration tests added (40 tests)
init.test.tscheck.test.ts--json,--ci,--adr,--verboseadr.test.tsadr-show-update.test.tsclean.test.tsreview-context.test.ts--domain,--run-checksTest plan
bun run validatepasses (lint, typecheck, format, tests, ADR check, build)