Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: error regression - unexpected ANSI color chars shown on Firefox warning message about chromeWebSecurity #20512

Merged
merged 2 commits into from
Mar 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/server/lib/project-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import * as settings from './util/settings'
import specsUtil from './util/specs'
import system from './util/system'
import Watchers from './watchers'
import stripAnsi from 'strip-ansi'

import type { LaunchArgs } from './open_project'

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

return {
...browser,
warning: browser.warning || errors.getMsgByType('CHROME_WEB_SECURITY_NOT_SUPPORTED', browser.name),
warning: browser.warning || stripAnsi(errors.getMsgByType('CHROME_WEB_SECURITY_NOT_SUPPORTED', browser.name)),
}
})
}
Expand Down
4 changes: 1 addition & 3 deletions packages/server/test/unit/project_spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
const { theme } = require('@packages/errors/src/errTemplate')

require('../spec_helper')

const mockedEnv = require('mocked-env')
Expand Down Expand Up @@ -248,7 +246,7 @@ describe('lib/project-base', () => {
family: 'some-other-family',
name: 'some-other-name',
warning: `\
Your project has set the configuration option: ${theme.yellow('chromeWebSecurity')} to ${theme.blue('false')}
Your project has set the configuration option: chromeWebSecurity to false

This option will not have an effect in Some-other-name. Tests that rely on web security being disabled will not run as expected.\
`,
Expand Down