You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This adds a basic bats-core test setup for node-reinstall:
make test runs bash -n ./node-reinstall and the BATS suite.
The BATS tests run the script with temporary HOME and PREFIX paths.
Destructive/external commands (sudo, rm, curl, node, npm, nvm, nave) are shadowed by mocks, so the tests can exercise the reinstall paths without deleting or installing anything.
The suite covers help/version/unknown option handling, default NVM install flow, requested version handling, installed-version reuse, Nave mode, and global npm module reinstall.
GitHub Actions runs the suite on Ubuntu and macOS.
Verified locally:
make test
Result: 7 BATS tests passing.
If the bounty on #49 is still active, happy to coordinate payout however you prefer after review.
CI note: the new test workflow has not actually run yet. GitHub shows the pull-request workflow run as action_required with zero jobs, so it likely needs maintainer approval for a first-time/fork workflow run.
Local verification still passes here:
make test
That runs bash -n ./node-reinstall plus 7 BATS tests. The tests shadow sudo, rm, curl, node, npm, nvm, and nave, and use temporary HOME/PREFIX paths so the destructive reinstall paths are exercised without touching the real machine.
Thanks @adamsardo for putting this together. It's been a while since I worked on this project, but I'll work through this PR today and get back up to speed. Please let me know a PayPal or Venmo address where I can pay the bounty.
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
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.
Addresses #49.
This adds a basic bats-core test setup for
node-reinstall:make testrunsbash -n ./node-reinstalland the BATS suite.HOMEandPREFIXpaths.sudo,rm,curl,node,npm,nvm,nave) are shadowed by mocks, so the tests can exercise the reinstall paths without deleting or installing anything.Verified locally:
make testResult: 7 BATS tests passing.
If the bounty on #49 is still active, happy to coordinate payout however you prefer after review.