Open
Description
Version
1.48.2
Steps to reproduce
- Create simple test:
import { test, expect } from '@playwright/test';
test('color', () => {
expect('foo').toBe('bar');
})
- Run Playwright with colors turned off:
FORCE_COLOR=0 DEBUG_COLORS=false npx playwright test
Expected behavior
I expect the output to lack any colors.
Actual behavior
Playwright's own output has no colors, but the output from expect
does have colors. This part:
Error: expect(received).toBe(expected) // Object.is equality
Expected: "bar"
Received: "foo"
Additional context
This seems related to #32543.
#32764 changed DEBUG_COLORS
to respect the environment, here (on line 40):
playwright/packages/playwright/src/runner/workerHost.ts
Lines 39 to 40 in ecf6f27
If I make the same adjustment to FORCE_COLOR
on line 39, the colors from expect
disappear too.
Environment
System:
OS: Linux 5.15 Ubuntu 22.04.5 LTS 22.04.5 LTS (Jammy Jellyfish)
CPU: (8) x64 Intel(R) Core(TM) i5-10310U CPU @ 1.70GHz
Memory: 1.29 GB / 11.69 GB
Container: Yes
Languages:
Bash: 5.1.16 - /usr/bin/bash
npmPackages:
@playwright/test: ^1.48.2 => 1.48.2