@@ -25,29 +25,33 @@ const failedUnzip = {
25
25
` ,
26
26
}
27
27
28
- const missingApp = ( binaryDir ) => ( {
29
- description : `No version of Cypress is installed in: ${ chalk . cyan ( binaryDir ) } ` ,
30
- solution : stripIndent `
28
+ const missingApp = ( binaryDir ) => {
29
+ return {
30
+ description : `No version of Cypress is installed in: ${ chalk . cyan ( binaryDir ) } ` ,
31
+ solution : stripIndent `
31
32
\nPlease reinstall Cypress by running: ${ chalk . cyan ( 'cypress install' ) }
32
33
` ,
33
- } )
34
+ }
35
+ }
34
36
35
- const binaryNotExecutable = ( executable ) => ( {
36
- description : `Cypress cannot run because the binary does not have executable permissions: ${ executable } ` ,
37
- solution : stripIndent `\n
37
+ const binaryNotExecutable = ( executable ) => {
38
+ return {
39
+ description : `Cypress cannot run because the binary does not have executable permissions: ${ executable } ` ,
40
+ solution : stripIndent `\n
38
41
Reasons this may happen:
39
42
40
43
- node was installed as 'root' or with 'sudo'
41
44
- the cypress npm package as 'root' or with 'sudo'
42
45
43
46
Please check that you have the appropriate user permissions.
44
47
` ,
45
- } )
46
-
48
+ }
49
+ }
47
50
48
- const notInstalledCI = ( executable ) => ( {
49
- description : 'The cypress npm package is installed, but the Cypress binary is missing.' ,
50
- solution : stripIndent `\n
51
+ const notInstalledCI = ( executable ) => {
52
+ return {
53
+ description : 'The cypress npm package is installed, but the Cypress binary is missing.' ,
54
+ solution : stripIndent `\n
51
55
We expected the binary to be installed here: ${ chalk . cyan ( executable ) }
52
56
53
57
Reasons it may be missing:
@@ -61,7 +65,8 @@ const notInstalledCI = (executable) => ({
61
65
62
66
${ chalk . blue ( 'https://on.cypress.io/not-installed-ci-error' ) }
63
67
` ,
64
- } )
68
+ }
69
+ }
65
70
66
71
const nonZeroExitCodeXvfb = {
67
72
description : 'XVFB exited with a non zero exit code.' ,
@@ -146,6 +151,7 @@ const removed = {
146
151
const CYPRESS_RUN_BINARY = {
147
152
notValid : ( value ) => {
148
153
const properFormat = `**/${ state . getPlatformExecutable ( ) } `
154
+
149
155
return {
150
156
description : `Could not run binary set by environment variable CYPRESS_RUN_BINARY=${ value } ` ,
151
157
solution : `Ensure the environment variable is a path to the Cypress binary, matching ${ properFormat } ` ,
@@ -155,15 +161,19 @@ const CYPRESS_RUN_BINARY = {
155
161
156
162
function getPlatformInfo ( ) {
157
163
return util . getOsVersionAsync ( )
158
- . then ( ( version ) => stripIndent `
164
+ . then ( ( version ) => {
165
+ return stripIndent `
159
166
Platform: ${ os . platform ( ) } (${ version } )
160
167
Cypress Version: ${ util . pkgVersion ( ) }
161
- ` )
168
+ `
169
+ } )
162
170
}
163
171
164
172
function addPlatformInformation ( info ) {
165
173
return getPlatformInfo ( )
166
- . then ( ( platform ) => merge ( info , { platform } ) )
174
+ . then ( ( platform ) => {
175
+ return merge ( info , { platform } )
176
+ } )
167
177
}
168
178
169
179
function formErrorText ( info , msg ) {
@@ -216,13 +226,16 @@ function formErrorText (info, msg) {
216
226
217
227
const raise = ( text ) => {
218
228
const err = new Error ( text )
229
+
219
230
err . known = true
220
231
throw err
221
232
}
222
233
223
- const throwFormErrorText = ( info ) => ( msg ) => {
224
- return formErrorText ( info , msg )
225
- . then ( raise )
234
+ const throwFormErrorText = ( info ) => {
235
+ return ( msg ) => {
236
+ return formErrorText ( info , msg )
237
+ . then ( raise )
238
+ }
226
239
}
227
240
228
241
module . exports = {
0 commit comments