test(edit_block): fix occurrence test false positives - #639
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe edit block occurrence tests now use a shared success-result assertion, expect ChangesEdit block test updates
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized test-only change corrects stale expectations and ensures assertion failures affect the test process exit code; the targeted and full test suites pass, so no actionable merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
Overlap note: #551 predates this PR and standardizes direct test entrypoints so a resolved |
Summary
test-edit-block-occurrences.jsto assert the current plain-textedit_blockpreview response instead of the pre-file-preview success stringrunTests()failures to the process exit code so the subprocess test runner cannot report an assertion failure as passedWhy
The test had drifted across two intentional contract changes:
[Reading ...]preview and updated other edit tests, but this occurrence test kept asserting the oldSuccessfully applied ...textold_stringvalues are intentionally treated as omitted byEditBlockArgsSchemaBecause the direct entrypoint ignored the boolean returned by
runTests(), those stale assertions printed failures while the process still exited 0, sotest/run-all-tests.jscounted the file as passed.Verification
main: Test 3 raisedERR_ASSERTIONwhilenode test/test-edit-block-occurrences.jsexited 0node test/test-edit-block-occurrences.jspasses all 6 cases with exit 0git diff --checkpassesnpm testrunner reports 47/47 passed, exit 0; investigation also exposed a separate pre-existing hidden failure intest-allowed-directories.js, which is intentionally not bundled into this PRSummary by CodeRabbit