Skip to content

fix(core): lazy initialize StatusRenderer to prevent clearing early error messages#891

Merged
fi3ework merged 1 commit intomainfrom
lazy-render-clear
Jan 21, 2026
Merged

fix(core): lazy initialize StatusRenderer to prevent clearing early error messages#891
fi3ework merged 1 commit intomainfrom
lazy-render-clear

Conversation

@fi3ework
Copy link
Copy Markdown
Member

Summary

  • Lazy initialize StatusRenderer in DefaultReporter to avoid early stdout/stderr interception
  • Fix visibility of fatal errors (e.g., missing Playwright browsers) in interactive terminals

human input:

when playwright doesn't installed any browsers, the error message throw from browser.launch will be cleared by StatusRenderer, while no test file has started yet. so lazy initialize StatusRenderer to allow error message throw in Rsbuild initializing phase.

Before After
image image

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings January 21, 2026 09:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an issue where early error messages (e.g., missing Playwright browsers) were being cleared by the StatusRenderer before tests actually started. The fix lazily initializes the StatusRenderer only when the first test file starts, ensuring that error messages during initialization remain visible.

Changes:

  • Modified DefaultReporter constructor to remove eager initialization of StatusRenderer
  • Added ensureStatusRenderer() private method to create StatusRenderer lazily
  • Updated onTestFileStart() to call ensureStatusRenderer() before using statusRenderer

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@fi3ework fi3ework enabled auto-merge (squash) January 21, 2026 09:53
@fi3ework fi3ework merged commit 2585781 into main Jan 21, 2026
22 of 23 checks passed
@fi3ework fi3ework deleted the lazy-render-clear branch January 21, 2026 10:36
@claneo
Copy link
Copy Markdown
Collaborator

claneo commented Feb 6, 2026

The actual reason Playwright’s error messages are not shown is that the reporter’s onTestRunEnd is never invoked.

Lazy initialization of StatusRenderer can leave the console blank while a slow build step is running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants