-
-
Notifications
You must be signed in to change notification settings - Fork 31
fix(browser): unify error reporting and avoid duplicate error messages #950
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,30 +44,16 @@ export class DefaultReporter implements Reporter { | |
| this.projectConfigs = projectConfigs ?? new Map(); | ||
| this.options = options; | ||
| this.testState = testState; | ||
| // Note: StatusRenderer is created lazily in onTestFileStart() to avoid | ||
| // intercepting stdout/stderr too early. This ensures that errors occurring | ||
| // before tests start (e.g., Playwright browser not installed) are visible | ||
| // and not cleared by WindowRenderer's TTY control sequences. | ||
| } | ||
|
|
||
| /** | ||
| * Lazily create StatusRenderer on first test file start. | ||
| * This avoids intercepting stdout/stderr before tests actually begin, | ||
| * ensuring early errors (like missing Playwright browsers) remain visible. | ||
| */ | ||
| private ensureStatusRenderer(): void { | ||
| if (this.statusRenderer) return; | ||
| if (isTTY() || this.options.logger) { | ||
| if (isTTY() || options.logger) { | ||
| this.statusRenderer = new StatusRenderer( | ||
| this.rootPath, | ||
| this.testState, | ||
| this.options.logger, | ||
| rootPath, | ||
| testState, | ||
| options.logger, | ||
|
fi3ework marked this conversation as resolved.
|
||
| ); | ||
| } | ||
|
Comment on lines
+47
to
53
|
||
| } | ||
|
|
||
| onTestFileStart(): void { | ||
| this.ensureStatusRenderer(); | ||
| this.statusRenderer?.onTestFileStart(); | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.