chore: do not show steps in line reporter without tty

This commit is contained in:
Pavel Feldman 2025-01-28 18:36:12 -08:00
parent b552637ee0
commit a7d0bd2cb7
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);