Test coverage gap
bin/utils/error.ts exports PakeError and isPakeError with no dedicated tests. isPakeError drives the clean user-facing error path in bin/cli.ts (print message, exit 1, no stack trace), and it has non-obvious branches worth locking in:
- the
instanceof PakeError path;
- the cross-module duck-typed fallback (
typeof error === 'object' && error.isUserError === true), which exists precisely because instances from a different module copy can fail instanceof;
- the
error !== null guard (since typeof null === 'object').
Proposal
Add tests/unit/error.test.ts covering PakeError's flag/name and all isPakeError branches (PakeError instance, duck-typed object, plain Error, isUserError: false/{}, and null/undefined). Tests only. PR attached.
Test coverage gap
bin/utils/error.tsexportsPakeErrorandisPakeErrorwith no dedicated tests.isPakeErrordrives the clean user-facing error path inbin/cli.ts(printmessage, exit 1, no stack trace), and it has non-obvious branches worth locking in:instanceof PakeErrorpath;typeof error === 'object' && error.isUserError === true), which exists precisely because instances from a different module copy can failinstanceof;error !== nullguard (sincetypeof null === 'object').Proposal
Add
tests/unit/error.test.tscoveringPakeError's flag/name and allisPakeErrorbranches (PakeError instance, duck-typed object, plain Error,isUserError: false/{}, andnull/undefined). Tests only. PR attached.