chore: do not show steps in line reporter without tty (#34529)

This commit is contained in:
Pavel Feldman 2025-01-29 12:41:09 -08:00 committed by GitHub
parent f15171bcf0
commit 4b5b326478
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -68,12 +68,12 @@ class LineReporter extends TerminalReporter {
}
onStepBegin(test: TestCase, result: TestResult, step: TestStep) {
if (step.category === 'test.step')
if (this.screen.isTTY && step.category === 'test.step')
this._updateLine(test, result, step);
}
onStepEnd(test: TestCase, result: TestResult, step: TestStep) {
if (step.category === 'test.step')
if (this.screen.isTTY && step.category === 'test.step')
this._updateLine(test, result, step.parent);
}

View file

@ -125,7 +125,7 @@ for (const useIntermediateMergeReport of [false, true] as const) {
});
});
`,
}, { reporter: 'line' });
}, { reporter: 'line' }, { PLAYWRIGHT_FORCE_TTY: '1' });
const text = result.output;
expect(text).toContain('[1/1] a.test.ts:3:15 passes outer inner');
expect(result.exitCode).toBe(0);