test: add coverage for installAll() - #100
Merged
Merged
Conversation
installAll() had zero test coverage, the last of the three untested methods (create/installAll/open) flagged in an internal spec-compliance audit - create and open were covered in earlier PRs. Adds two tests: the happy path (installs every package currently in listPackages() and returns them with installed=true) and the unprivileged-elevation branch (mirrors the existing install() elevation tests). The happy-path test seeds a single known package directly via addPackage() rather than sync()'ing the live registry, so its network footprint stays fixed regardless of how many packages the real registry ends up with. Co-Authored-By: Claude Sonnet 5 <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 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
installAll()had zero test coverage — the last of the three untested methods (create/installAll/open) flagged in an internal spec-compliance audit;createandopenwere covered in earlier PRs ([fix] Make create command persist metadata instead of always throwing #91, [fix] Let open() propagate errors instead of swallowing them #98).listPackages()and returns them withinstalled: true) and the unprivileged-elevation branch (mirrors the existinginstall()elevation tests).addPackage()rather thansync()'ing the live registry, so its network footprint stays fixed regardless of how many packages the real registry ends up with.Test plan
npm run checkpasses (format, lint, build, tests — 205/205)🤖 Generated with Claude Code