mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
fix(test runner): dot reporter incorrectly splits by 80 (#7925)
This commit is contained in:
parent
2e387b3a3a
commit
5a3ebfc9f9
@ -23,10 +23,11 @@ class DotReporter extends BaseReporter {
|
||||
|
||||
onTestEnd(test: TestCase, result: TestResult) {
|
||||
super.onTestEnd(test, result);
|
||||
if (++this._counter === 81) {
|
||||
if (this._counter === 80) {
|
||||
process.stdout.write('\n');
|
||||
return;
|
||||
this._counter = 0;
|
||||
}
|
||||
++this._counter;
|
||||
if (result.status === 'skipped') {
|
||||
process.stdout.write(colors.yellow('°'));
|
||||
return;
|
||||
@ -37,7 +38,7 @@ class DotReporter extends BaseReporter {
|
||||
}
|
||||
switch (test.outcome()) {
|
||||
case 'expected': process.stdout.write(colors.green('·')); break;
|
||||
case 'unexpected': process.stdout.write(colors.red(test.results[test.results.length - 1].status === 'timedOut' ? 'T' : 'F')); break;
|
||||
case 'unexpected': process.stdout.write(colors.red(result.status === 'timedOut' ? 'T' : 'F')); break;
|
||||
case 'flaky': process.stdout.write(colors.yellow('±')); break;
|
||||
}
|
||||
}
|
||||
|
@ -90,3 +90,20 @@ test('should work from config', async ({ runInlineTest }) => {
|
||||
expect(result.output).toContain(colors.green('·'));
|
||||
expect(result.exitCode).toBe(0);
|
||||
});
|
||||
|
||||
test('render 243 tests in rows by 80', async ({ runInlineTest }) => {
|
||||
const result = await runInlineTest({
|
||||
'a.test.js': `
|
||||
const { test } = pwt;
|
||||
for (let i = 0; i < 243; i++) {
|
||||
test('test' + i, () => {});
|
||||
}
|
||||
`,
|
||||
});
|
||||
expect(result.exitCode).toBe(0);
|
||||
expect(result.output).toContain(
|
||||
colors.green('·').repeat(80) + '\n' +
|
||||
colors.green('·').repeat(80) + '\n' +
|
||||
colors.green('·').repeat(80) + '\n' +
|
||||
colors.green('·').repeat(3));
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user