fix(test): isolate run-loop mocks from run-eval suite#27
Conversation
🤖 Robin✅ Finished the review. I found 2 issues. After you push fixes, comment |
There was a problem hiding this comment.
🤖 Robin
Review flow: this is a point-in-time review. Push fixes freely, then comment
/reviewwhen you want Robin to run again.
🔵 1 Low | 💡 1 Suggestions
Summary
The diff improves Bun test isolation by moving module mocks into the test and delaying the run-loop import until after mocks are registered, with cleanup in a finally block. I found no high- or medium-severity runtime, security, or data-loss risks in the diff. The main concerns are maintainability risks around the broad docs/ ignore rule and potential future mock leakage if more tests are added to the same file.
Robin — free AI code reviews for every PR.
Move run-loop module mocks into the test body and run Bun tests with --isolate so mock.module cannot leak across files and break run-eval imports during publish prepack. Co-authored-by: Cursor <cursoragent@cursor.com>
11f16b2 to
8e691ac
Compare
|
/review Addressed review items in 8e691ac:
Verification:
|
🤖 Robin✅ Finished the review. I did not find any issues. After you push fixes, comment |
There was a problem hiding this comment.
🤖 Robin
Review flow: this is a point-in-time review. Push fixes freely, then comment
/reviewwhen you want Robin to run again.
✅ No issues found
Summary
The change improves test isolation by moving Bun module mocks inside the test and restoring them in a finally block, which reduces cross-test contamination. The added --isolate flag for TypeScript tests is consistent with that goal. I don't see any blocking correctness, security, reliability, or architecture issues in the diff.
Robin — free AI code reviews for every PR.
Summary
mock.modulecalls inrun-loop.test.tsinto the test body and restore mocks infinally, so module stubs are not registered at file load time.--isolateintest:tsso each test file gets a fresh global scope andmock.modulecannot leak across files.Fixes the flaky publish failure in #28 where
run-eval.test.tsfailed whenrun-loop.test.tsran first:Test plan
bun test --randomize --isolate test/*.test.ts(10 consecutive runs, 0 failures)bun test test/*.test.ts(42 pass)npm testinplugin/Made with Cursor