Skip to content

Commit 047aefc

Browse files
fix: error regression - unexpected ANSI color chars shown on Firefox warning message about chromeWebSecurity (#20512)
1 parent 2d81628 commit 047aefc

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

packages/server/lib/project-base.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import * as settings from './util/settings'
3030
import specsUtil from './util/specs'
3131
import system from './util/system'
3232
import Watchers from './watchers'
33+
import stripAnsi from 'strip-ansi'
3334

3435
import type { LaunchArgs } from './open_project'
3536

@@ -704,7 +705,7 @@ export class ProjectBase<TServer extends ServerE2E | ServerCt> extends EE {
704705

705706
return {
706707
...browser,
707-
warning: browser.warning || errors.getMsgByType('CHROME_WEB_SECURITY_NOT_SUPPORTED', browser.name),
708+
warning: browser.warning || stripAnsi(errors.getMsgByType('CHROME_WEB_SECURITY_NOT_SUPPORTED', browser.name)),
708709
}
709710
})
710711
}

packages/server/test/unit/project_spec.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
const { theme } = require('@packages/errors/src/errTemplate')
2-
31
require('../spec_helper')
42

53
const mockedEnv = require('mocked-env')
@@ -248,7 +246,7 @@ describe('lib/project-base', () => {
248246
family: 'some-other-family',
249247
name: 'some-other-name',
250248
warning: `\
251-
Your project has set the configuration option: ${theme.yellow('chromeWebSecurity')} to ${theme.blue('false')}
249+
Your project has set the configuration option: chromeWebSecurity to false
252250
253251
This option will not have an effect in Some-other-name. Tests that rely on web security being disabled will not run as expected.\
254252
`,

0 commit comments

Comments
 (0)