fix(list reporter): use positive-status-mark for last result row

This commit is contained in:
Simon Knott 2024-07-17 09:33:08 +02:00
parent 9df34356af
commit d9994ac127
No known key found for this signature in database
GPG key ID: 8CEDC00028084AEC

View file

@ -126,7 +126,7 @@ for (const useIntermediateMergeReport of [false, true] as const) {
]);
});
test('render steps in non-TTY mode', async ({ runInlineTest }) => {
test.only('render steps in non-TTY mode', async ({ runInlineTest }) => {
const result = await runInlineTest({
'a.test.ts': `
import { test, expect } from '@playwright/test';
@ -144,7 +144,6 @@ for (const useIntermediateMergeReport of [false, true] as const) {
}, { reporter: 'list' }, { PW_TEST_DEBUG_REPORTERS: '1', PLAYWRIGHT_LIST_PRINT_STEPS: '1' });
const text = result.output;
const lines = text.split('\n').filter(l => l.match(/^#.* :/)).map(l => l.replace(/[.\d]+m?s/, 'Xms'));
lines.pop(); // Remove last item that contains [v] and time in ms.
expect(lines).toEqual([
'#0 : 1.1 a.test.ts:5:26 passes outer 1.0 inner 1.1 (Xms)',
'#1 : 1.2 a.test.ts:6:26 passes outer 1.0 inner 1.2 (Xms)',
@ -152,6 +151,7 @@ for (const useIntermediateMergeReport of [false, true] as const) {
'#3 : 1.4 a.test.ts:9:26 passes outer 2.0 inner 2.1 (Xms)',
'#4 : 1.5 a.test.ts:10:26 passes outer 2.0 inner 2.2 (Xms)',
'#5 : 1.6 a.test.ts:8:24 passes outer 2.0 (Xms)',
`#6 : ${POSITIVE_STATUS_MARK} 1 a.test.ts:3:15 passes (Xms)`,
]);
});