test: make npm failure diagnostics deterministic - #138
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe package contract test replaces a real npm child process with a mocked process that emits deterministic stdout and stderr before closing with exit status 1, then verifies the rejection includes both captured outputs. Changesnpm failure handling test
Estimated code review effort: 1 (Trivial) | ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
Maintainer self-review complete. The diff is limited to the existing |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Resolves #137.
The Windows Node 22 failure was the captured-output formatter test itself: it launched a real
npm execprocess while Vitest applied its five-second per-test limit. The production command has its own 25-second lifecycle; the test was not a valid latency assertion.This keeps real package behavior covered by the existing pack, check:pack, tarball-install, CLI, and smoke contracts. It changes only the formatter unit test to use the existing injectable child-process seam, explicitly writing stdout/stderr and closing with status 1.
No production behavior, timeout, coverage, shell setting, package validation, or process containment changed.
Local validation:
CI must validate the exact head on Linux, macOS, and all Windows Node versions before merge.
Summary by CodeRabbit