Skip to content

Commit 1dcf1c2

Browse files
committed
chore: dim as gray in CI
1 parent 46b49d3 commit 1dcf1c2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

packages/e2e/shared/playwright/reporter.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,25 @@ import type {
1010
import { styleText } from 'node:util'
1111

1212
const validateStream = false // always emit color codes, even when stdout is not a TTY or reports no color support (for consistent colored output in CI and captured logs)
13+
const dimStyle = process.env.CI ? 'gray' : 'dim'
14+
const dimYellowStyle: Parameters<typeof styleText>[0] =
15+
dimStyle === 'dim' ? ['dim', 'yellow'] : ['yellow']
1316
const ellipsis = '…'
1417

1518
const statusSymbols: Record<TestResult['status'], string> = {
1619
passed: styleText('green', '✓', { validateStream }),
1720
failed: styleText('red', '✗', { validateStream }),
18-
skipped: styleText(['dim', 'yellow'], '~', { validateStream }),
21+
skipped: styleText(dimYellowStyle, '~', { validateStream }),
1922
timedOut: styleText('red', '!', { validateStream }),
2023
interrupted: styleText('cyan', '?', { validateStream })
2124
}
2225

2326
function dim(text: string) {
24-
return styleText(['dim'], text, { validateStream })
27+
return styleText(dimStyle, text, { validateStream })
2528
}
2629

2730
function dimYellow(text: string) {
28-
return styleText(['dim', 'yellow'], text, { validateStream })
31+
return styleText(dimYellowStyle, text, { validateStream })
2932
}
3033

3134
function stripAnsi(text: string) {

0 commit comments

Comments
 (0)