mirror of
https://github.com/cypress-io/cypress.git
synced 2026-02-04 14:19:55 -06:00
cli: better stdout normalization
This commit is contained in:
@@ -1,3 +1,25 @@
|
||||
exports['xvfb fails 1'] = `[33mIt looks like this is your first time using Cypress: [36m1.2.3[33m[39m
|
||||
|
||||
[?25l [31m✖[39m [34m Verifying Cypress can run [90m/path/to/executable/dir[34m[39m
|
||||
|
||||
[?25h[31mError: Your system is missing the dependency: XVFB[39m
|
||||
[31m[39m
|
||||
[31mInstall XVFB and run Cypress again.[39m
|
||||
[31m[39m
|
||||
[31mRead our documentation on dependencies for more information:[39m
|
||||
[31m[39m
|
||||
[31mhttps://on.cypress.io/required-dependencies[39m
|
||||
[31m[39m
|
||||
[31mIf you using Docker, we provide containers with all required dependencies installed.[39m
|
||||
[31m----------[39m
|
||||
[31m[39m
|
||||
[31mCaught error trying to run XVFB: "test without xvfb"[39m
|
||||
[31m----------[39m
|
||||
[31m[39m
|
||||
[31mPlatform: darwin (test release)[39m
|
||||
[31mCypress Version: 1.2.3[39m
|
||||
`
|
||||
|
||||
exports['no version of Cypress installed 1'] = `[31mError: No version of Cypress is installed.[39m
|
||||
[31m[39m
|
||||
[31mPlease reinstall Cypress by running: [36mcypress install[31m[39m
|
||||
@@ -36,7 +58,7 @@ exports['verification with executable 1'] = `[33mIt looks like this is your fir
|
||||
exports['fails verifying Cypress 1'] = `[33mIt looks like this is your first time using Cypress: [36m1.2.3[33m[39m
|
||||
|
||||
[?25l [31m✖[39m [34m Verifying Cypress can run [90m/path/to/executable/dir[34m[39m
|
||||
|
||||
|
||||
[?25h[31mError: Cypress failed to start.[39m
|
||||
[31m[39m
|
||||
[31mThis is usually caused by a missing library or dependency.[39m
|
||||
@@ -65,25 +87,3 @@ exports['current version has not been verified 1'] = `[33mIt looks like this is
|
||||
[?25l [32m✔[39m [34m [32mVerified Cypress![34m [90m/path/to/executable/dir[34m[39m
|
||||
[?25h`
|
||||
|
||||
exports['xfvb fails 1'] = `[33mIt looks like this is your first time using Cypress: [36m1.2.3[33m[39m
|
||||
|
||||
[?25l [31m✖[39m [34m Verifying Cypress can run [90m/path/to/executable/dir[34m[39m
|
||||
|
||||
[?25h[31mError: Your system is missing the dependency: XVFB[39m
|
||||
[31m[39m
|
||||
[31mInstall XVFB and run Cypress again.[39m
|
||||
[31m[39m
|
||||
[31mRead our documentation on dependencies for more information:[39m
|
||||
[31m[39m
|
||||
[31mhttps://on.cypress.io/required-dependencies[39m
|
||||
[31m[39m
|
||||
[31mIf you using Docker, we provide containers with all required dependencies installed.[39m
|
||||
[31m----------[39m
|
||||
[31m[39m
|
||||
[31mCaught error trying to run XVFB: "test without xvfb"[39m
|
||||
[31m----------[39m
|
||||
[31m[39m
|
||||
[31mPlatform: darwin (test release)[39m
|
||||
[31mCypress Version: 1.2.3[39m
|
||||
`
|
||||
|
||||
|
||||
@@ -20,9 +20,12 @@ const packageVersion = '1.2.3'
|
||||
const executablePath = '/path/to/executable'
|
||||
const executableDir = '/path/to/executable/dir'
|
||||
const installationDir = info.getInstallationDir()
|
||||
const replaceRe = /(.+REPLACER)/g
|
||||
|
||||
const normalize = (str) => {
|
||||
return str.replace('[90m→ Cypress Version: 1.2.3[39m', '')
|
||||
return str
|
||||
.replace('[90m→ Cypress Version: 1.2.3[39m', 'REPLACER')
|
||||
.replace(replaceRe, '')
|
||||
}
|
||||
|
||||
context('.verify', function () {
|
||||
@@ -282,7 +285,7 @@ context('.verify', function () {
|
||||
|
||||
logger.error(err)
|
||||
|
||||
snapshot('xfvb fails', normalize(ctx.stdout.toString()))
|
||||
snapshot('xvfb fails', normalize(ctx.stdout.toString()))
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user