Add tests for verifyPeerReview CLI skeleton#78
Merged
Conversation
Adds a trimmed tests/verifyPeerReviewCli.test.ts that exercises CLI argument parsing against the current no-op skeleton, plus the test npm script and CI workflow to run it. GitHubUtils stubbing will be reintroduced in Phase 3 once the real logic lands. Co-authored-by: Cursor <cursoragent@cursor.com>
…tests # Conflicts: # package.json
marcochavezf
approved these changes
Jul 3, 2026
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.
Details
Adds a test file for
scripts/verifyPeerReview.ts's CLI argument parsing:tests/verifyPeerReviewCli.test.ts— exercises CLI argument parsing (owner/repo/pull-request-number/base-ref, viaexpensify-common/CLI) againstscripts/verifyPeerReview.ts. The script currently only parses and logs its CLI arguments (it doesn't call the GitHub API yet), so the test only covers argument parsing..github/workflows/test.yml— CI workflow that runsnpm teston relevant file changes.testnpm script (tsx --test tests/*.test.ts), using Node's built-innode:testrunner. No new dependencies were needed sincetsxwas already a devDependency.Verified the CLI's missing-required-argument behavior directly against
node_modules/expensify-common/dist/CLI.js: when a required named arg is missing, the constructor throwsError("Missing required named argument --<name>"), which is caught internally and results in a synchronousprocess.exit(1)call. Since the test mocksprocess.exitto throw, andmain()constructs theCLIsynchronously (not awaited), this manifests asmain()'s returned promise rejecting withexit 1— matching the assertion in the test.Related Issues
https://github.com/Expensify/Expensify/issues/636197
Manual Tests
Ran
npm testlocally — both test cases pass (parses required CLI args successfully; fails when required args are missing).Linked PRs
N/A
Made with Cursor