Skip to content

CLI: remove fixed timeouts from InteractiveCliApp unit tests; document rule#1214

Draft
terryyin wants to merge 1 commit intomainfrom
cursor/unit-test-timeout-removal-rule-fa13
Draft

CLI: remove fixed timeouts from InteractiveCliApp unit tests; document rule#1214
terryyin wants to merge 1 commit intomainfrom
cursor/unit-test-timeout-removal-rule-fa13

Conversation

@terryyin
Copy link
Copy Markdown
Member

Summary

  • Replaced setTimeout(..., 50) waits in cli/tests/InteractiveCliApp.test.tsx with waitForFrames, which advances the event loop via setImmediate until the combined frame output satisfies the same assertions the test already made (or fails with a clear error after a turn-count cap).
  • Documented in .cursor/rules/cli.mdc that CLI Vitest unit tests must not use wall-clock sleeps for “letting Ink catch up”; prefer observable conditions plus event-loop turns, with E2E as the place for bounded retries where needed.

Testing

  • pnpm cli:test
Open in Web Open in Cursor 

Use event-loop polling until observable frame content matches instead
of setTimeout(50). Document no wall-clock sleeps in cli.mdc Vitest rules.

Co-authored-by: terry <terry@odd-e.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants