Skip to content

fix: add resetStatusBar() and fix test state pollution#9

Closed
victor0602 wants to merge 1 commit intoMiniMax-AI:mainfrom
victor0602:pr/fix-test-reset-status-bar
Closed

fix: add resetStatusBar() and fix test state pollution#9
victor0602 wants to merge 1 commit intoMiniMax-AI:mainfrom
victor0602:pr/fix-test-reset-status-bar

Conversation

@victor0602
Copy link
Copy Markdown
Collaborator

Summary

Fixes test flakiness caused by the module-level statusBarPrinted flag in src/client/http.ts.

Changes

  • src/client/http.ts: Export a new resetStatusBar() function that resets statusBarPrinted to false. Call this in test afterEach hooks to prevent state from leaking between test files.
  • test/client/http.test.ts: Import resetStatusBar(), add afterEach call, set quiet: true and noColor: true on all configs (was quiet: false).
  • test/commands/text/chat.test.ts: Same resetStatusBar() import + afterEach, fix dry-run test config quiet: false → true.
  • test/commands/video/task-get.test.ts: Same resetStatusBar() import + afterEach. Config kept quiet: false — that test exercises a known command bug (stdout/json mixing) that belongs in a separate PR.

All 62 tests pass.

src/client/http.ts:
- Export resetStatusBar() to reset the module-level statusBarPrinted
  flag between test runs. Without this, a test that prints the status bar
  pollutes the state for subsequent tests in the same process.

test/:
- test/client/http.test.ts: import resetStatusBar(), call it in afterEach,
  set quiet:true/noColor:true on all configs (was quiet:false/noColor:false).
- test/commands/text/chat.test.ts: same resetStatusBar() + afterEach + fix
  dry-run test config from quiet:false → quiet:true.
- test/commands/video/task-get.test.ts: same resetStatusBar() + afterEach.
  config kept at quiet:false — the command itself has a stdout/json bug when
  quiet:true that belongs to a separate fix.
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