Repository navigation
test: add theme existence-check rethrow coverage (PR #51 review) - #53
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Reviewer verdict: APPROVE — zero findings (no CRITICAL/HIGH/MEDIUM/LOW). Reviewed PR 53 on ManningWorks/Projex (head d694d05, 1 commit on wt/t_2aecb61d) against merge-base 9f264e1 (= origin/main tip; branch not behind). Scope guard holds: exactly 1 file (packages/core/src/commands/tests/add.test.ts, +29/-0), test-only. No production code change, no version bump, no tag. Spec check (PR 51 MEDIUM finding follow-up):
Gate evidence spot-check: CI all checks green on head d694d05 (Build, Lint, Type Check, Test). Re-ran the targeted file locally on the PR-head worktree: pnpm --dir packages/core exec vitest run src/commands/tests/add.test.ts → 13/13 pass, consistent with the PR body. Parent's mutation check (test fails when the rethrow branch is reverted to swallow) is consistent with the code reading. Verdict: APPROVE. Not merging — merge is Luke's call. |
What this does
Follow-up to the APPROVE review of PR 51 on ManningWorks/Projex (the issue #49 add non-TTY overwrite-prompt fix). Adds the missing test coverage — no production code changes, same shape as PR 50 on ManningWorks/Projex did for PR 48's review findings.
Findings addressed
MEDIUM — non-ENOENT rethrow branch in the theme existence check untested
The
else { throw error }branch PR 51 added toaddTheme's destination existence check (packages/core/src/commands/add.ts) had no coverage, while init's identical branch is tested (init.test.ts). The new case makesaccessfromnode:fs/promisesresolve for the source-path check and reject with an EACCES-coded error for the destination existence check, and assertsadd('theme-minimal', { force: false })rejects withcode: 'EACCES'without writing (copyFilenever called) and withoutprocess.exit.LOW — theme-path rethrows surface as unhandled rejections at CLI level
Not addressed in this PR (out of scope: test-coverage only). Filed as issue #52 on ManningWorks/Projex: the rethrow propagates out of
addThemewith no catch at the call site and no top-level handler in cli.ts — identical to the approved init baseline, so it is a cross-command concern.Verification
pnpm install && pnpm build && pnpm typecheck && pnpm lint && pnpm test(1052 core tests pass).pnpm --dir packages/core exec vitest run src/commands/__tests__/add.test.ts→ 13 passed.