1
1
import AU from 'ansi_up'
2
2
import os from 'os'
3
- /* eslint-disable no-console */
3
+
4
4
import chalk from 'chalk'
5
5
import _ from 'lodash'
6
6
import path from 'path'
@@ -145,7 +145,7 @@ export const AllCypressErrors = {
145
145
return errTemplate `${ fmt . off ( `\n ` ) } This spec and its tests were skipped because the run has been canceled.`
146
146
} ,
147
147
CLOUD_API_RESPONSE_FAILED_RETRYING : (
148
- arg1 : { tries : number , delayMs : number , response : Error } ,
148
+ arg1 : { tries : number , delayMs : number , response : Error } ,
149
149
) => {
150
150
const time = pluralize ( 'time' , arg1 . tries )
151
151
const delay = humanTime . long ( arg1 . delayMs , false )
@@ -160,9 +160,8 @@ export const AllCypressErrors = {
160
160
We will retry ${ fmt . off ( arg1 . tries ) } more ${ fmt . off ( time ) } in ${ fmt . off ( delay ) } ...
161
161
`
162
162
/* Because of fmt.listFlags() and fmt.listItems() */
163
- /* eslint-disable indent */
164
163
} ,
165
- CLOUD_CANNOT_PROCEED_IN_PARALLEL : ( arg1 : { flags : any , response : Error } ) => {
164
+ CLOUD_CANNOT_PROCEED_IN_PARALLEL : ( arg1 : { flags : any , response : Error } ) => {
166
165
const message = normalizeNetworkErrorMessage ( arg1 . response )
167
166
168
167
return errTemplate `\
@@ -177,7 +176,7 @@ export const AllCypressErrors = {
177
176
ciBuildId : '--ciBuildId' ,
178
177
} ) } `
179
178
} ,
180
- CLOUD_CANNOT_PROCEED_IN_SERIAL : ( arg1 : { flags : any , response : Error } ) => {
179
+ CLOUD_CANNOT_PROCEED_IN_SERIAL : ( arg1 : { flags : any , response : Error } ) => {
181
180
const message = normalizeNetworkErrorMessage ( arg1 . response )
182
181
183
182
return errTemplate `\
@@ -192,7 +191,7 @@ export const AllCypressErrors = {
192
191
ciBuildId : '--ciBuildId' ,
193
192
} ) } `
194
193
} ,
195
- CLOUD_UNKNOWN_INVALID_REQUEST : ( arg1 : { flags : any , response : Error } ) => {
194
+ CLOUD_UNKNOWN_INVALID_REQUEST : ( arg1 : { flags : any , response : Error } ) => {
196
195
const message = normalizeNetworkErrorMessage ( arg1 . response )
197
196
198
197
return errTemplate `\
@@ -209,7 +208,7 @@ export const AllCypressErrors = {
209
208
ciBuildId : '--ciBuildId' ,
210
209
} ) } `
211
210
} ,
212
- CLOUD_UNKNOWN_CREATE_RUN_WARNING : ( arg1 : { props ?: any , message : string } ) => {
211
+ CLOUD_UNKNOWN_CREATE_RUN_WARNING : ( arg1 : { props ?: any , message : string } ) => {
213
212
if ( ! Object . keys ( arg1 . props ) . length ) {
214
213
return errTemplate `\
215
214
Warning from Cypress Cloud: ${ fmt . highlight ( arg1 . message ) }
@@ -222,7 +221,7 @@ export const AllCypressErrors = {
222
221
Details:
223
222
${ fmt . meta ( arg1 . props ) } `
224
223
} ,
225
- CLOUD_STALE_RUN : ( arg1 : { runUrl : string , [ key : string ] : any } ) => {
224
+ CLOUD_STALE_RUN : ( arg1 : { runUrl : string , [ key : string ] : any } ) => {
226
225
return errTemplate `\
227
226
You are attempting to pass the ${ fmt . flag ( `--parallel` ) } flag to a run that was completed over 24 hours ago.
228
227
@@ -239,7 +238,7 @@ export const AllCypressErrors = {
239
238
240
239
https://on.cypress.io/stale-run`
241
240
} ,
242
- CLOUD_ALREADY_COMPLETE : ( props : { runUrl : string , tags : string , group : string , parallel : string , ciBuildId : string } ) => {
241
+ CLOUD_ALREADY_COMPLETE : ( props : { runUrl : string , tags : string , group : string , parallel : string , ciBuildId : string } ) => {
243
242
return errTemplate `\
244
243
The run you are attempting to access is already complete and will not accept new groups.
245
244
@@ -256,7 +255,7 @@ export const AllCypressErrors = {
256
255
257
256
https://on.cypress.io/already-complete`
258
257
} ,
259
- CLOUD_PARALLEL_REQUIRED : ( arg1 : { tags : string , group : string , runUrl : string , ciBuildId : string } ) => {
258
+ CLOUD_PARALLEL_REQUIRED : ( arg1 : { tags : string , group : string , runUrl : string , ciBuildId : string } ) => {
260
259
return errTemplate `\
261
260
You did not pass the ${ fmt . flag ( `--parallel` ) } flag, but this run's group was originally created with the --parallel flag.
262
261
@@ -273,7 +272,7 @@ export const AllCypressErrors = {
273
272
274
273
https://on.cypress.io/parallel-required`
275
274
} ,
276
- CLOUD_PARALLEL_DISALLOWED : ( arg1 : { tags : string , group : string , runUrl : string , ciBuildId : string } ) => {
275
+ CLOUD_PARALLEL_DISALLOWED : ( arg1 : { tags : string , group : string , runUrl : string , ciBuildId : string } ) => {
277
276
return errTemplate `\
278
277
You passed the ${ fmt . flag ( `--parallel` ) } flag, but this run group was originally created without the --parallel flag.
279
278
@@ -290,7 +289,7 @@ export const AllCypressErrors = {
290
289
291
290
https://on.cypress.io/parallel-disallowed`
292
291
} ,
293
- CLOUD_PARALLEL_GROUP_PARAMS_MISMATCH : ( arg1 : { group : string , runUrl : string , ciBuildId : string , parameters : any , payload : any } ) => {
292
+ CLOUD_PARALLEL_GROUP_PARAMS_MISMATCH : ( arg1 : { group : string , runUrl : string , ciBuildId : string , parameters : any , payload : any } ) => {
294
293
let params : any = arg1 . parameters
295
294
296
295
if ( arg1 . payload ?. differentParams ) {
@@ -344,7 +343,7 @@ export const AllCypressErrors = {
344
343
345
344
https://on.cypress.io/parallel-group-params-mismatch`
346
345
} ,
347
- CLOUD_RUN_GROUP_NAME_NOT_UNIQUE : ( arg1 : { group : string , runUrl : string , ciBuildId ?: string | null } ) => {
346
+ CLOUD_RUN_GROUP_NAME_NOT_UNIQUE : ( arg1 : { group : string , runUrl : string , ciBuildId ?: string | null } ) => {
348
347
return errTemplate `\
349
348
You passed the ${ fmt . flag ( `--group` ) } flag, but this group name has already been used for this run.
350
349
@@ -362,15 +361,15 @@ export const AllCypressErrors = {
362
361
363
362
https://on.cypress.io/run-group-name-not-unique`
364
363
} ,
365
- CLOUD_AUTO_CANCEL_NOT_AVAILABLE_IN_PLAN : ( arg1 : { link : string } ) => {
364
+ CLOUD_AUTO_CANCEL_NOT_AVAILABLE_IN_PLAN : ( arg1 : { link : string } ) => {
366
365
return errTemplate `\
367
366
${ fmt . highlightSecondary ( `Auto Cancellation` ) } is not included under your current billing plan.
368
367
369
368
To enable this service, please visit your billing and upgrade to another plan with Auto Cancellation.
370
369
371
370
${ fmt . off ( arg1 . link ) } `
372
371
} ,
373
- CLOUD_AUTO_CANCEL_MISMATCH : ( arg1 : { runUrl : string , tags : string , group : string , parallel : string , ciBuildId : string , autoCancelAfterFailures : string } ) => {
372
+ CLOUD_AUTO_CANCEL_MISMATCH : ( arg1 : { runUrl : string , tags : string , group : string , parallel : string , ciBuildId : string , autoCancelAfterFailures : string } ) => {
374
373
return errTemplate `\
375
374
You passed the ${ fmt . flag ( `--auto-cancel-after-failures` ) } flag, but this run originally started with a different value for the ${ fmt . flag ( `--auto-cancel-after-failures` ) } flag.
376
375
@@ -442,7 +441,6 @@ export const AllCypressErrors = {
442
441
The --ci-build-id flag is used to either group or parallelize multiple runs together.
443
442
444
443
https://on.cypress.io/incorrect-ci-build-id-usage`
445
- /* eslint-enable indent */
446
444
} ,
447
445
RECORD_KEY_MISSING : ( ) => {
448
446
return errTemplate `\
@@ -487,7 +485,7 @@ export const AllCypressErrors = {
487
485
488
486
https://on.cypress.io/recording-project-runs`
489
487
} ,
490
- CLOUD_INVALID_RUN_REQUEST : ( arg1 : { message : string , errors : string [ ] , object : object } ) => {
488
+ CLOUD_INVALID_RUN_REQUEST : ( arg1 : { message : string , errors : string [ ] , object : object } ) => {
491
489
return errTemplate `\
492
490
Recording this run failed. The request was invalid.
493
491
@@ -626,7 +624,7 @@ export const AllCypressErrors = {
626
624
return AllCypressErrors . CLOUD_PROTOCOL_UPLOAD_NETWORK_FAILURE ( firstError as Error & { url : string } )
627
625
}
628
626
629
- return AllCypressErrors . CLOUD_PROTOCOL_UPLOAD_HTTP_FAILURE ( error . errors [ 0 ] as Error & { url : string , status : number , statusText : string , responseBody : string } )
627
+ return AllCypressErrors . CLOUD_PROTOCOL_UPLOAD_HTTP_FAILURE ( error . errors [ 0 ] as Error & { url : string , status : number , statusText : string , responseBody : string } )
630
628
}
631
629
632
630
let systemErr = error . errors . find ( ( err ) => {
@@ -931,7 +929,7 @@ export const AllCypressErrors = {
931
929
932
930
Instead the value was: ${ fmt . stringify ( value ) } `
933
931
} ,
934
- RENAMED_CONFIG_OPTION : ( arg1 : { name : string , newName : string } ) => {
932
+ RENAMED_CONFIG_OPTION : ( arg1 : { name : string , newName : string } ) => {
935
933
return errTemplate `\
936
934
The ${ fmt . highlight ( arg1 . name ) } configuration option you have supplied has been renamed.
937
935
@@ -952,7 +950,7 @@ export const AllCypressErrors = {
952
950
This server has been configured as your ${ fmt . highlight ( `baseUrl` ) } , and tests will likely fail if it is not running.`
953
951
} ,
954
952
// TODO: test this
955
- CANNOT_CONNECT_BASE_URL_RETRYING : ( arg1 : { attempt : number , baseUrl : string , remaining : number , delay : number } ) => {
953
+ CANNOT_CONNECT_BASE_URL_RETRYING : ( arg1 : { attempt : number , baseUrl : string , remaining : number , delay : number } ) => {
956
954
switch ( arg1 . attempt ) {
957
955
case 1 :
958
956
return errTemplate `\
@@ -970,7 +968,7 @@ export const AllCypressErrors = {
970
968
}
971
969
} ,
972
970
// TODO: test this
973
- INVALID_REPORTER_NAME : ( arg1 : { name : string , paths : string [ ] , error : Error } ) => {
971
+ INVALID_REPORTER_NAME : ( arg1 : { name : string , paths : string [ ] , error : Error } ) => {
974
972
return errTemplate `\
975
973
Error loading the reporter: ${ fmt . highlight ( arg1 . name ) }
976
974
@@ -1016,15 +1014,15 @@ export const AllCypressErrors = {
1016
1014
1017
1015
https://on.cypress.io/installing-cypress`
1018
1016
} ,
1019
- FREE_PLAN_EXCEEDS_MONTHLY_TESTS : ( arg1 : { link : string , usedTestsMessage : string , limit : number } ) => {
1017
+ FREE_PLAN_EXCEEDS_MONTHLY_TESTS : ( arg1 : { link : string , usedTestsMessage : string , limit : number } ) => {
1020
1018
return errTemplate `\
1021
1019
You've exceeded the limit of test results under your free plan this month. ${ getUsedTestsMessage ( arg1 . limit , arg1 . usedTestsMessage ) }
1022
1020
1023
1021
To continue recording tests this month you must upgrade your account. Please visit your billing to upgrade to another billing plan.
1024
1022
1025
1023
${ fmt . off ( arg1 . link ) } `
1026
1024
} ,
1027
- FREE_PLAN_IN_GRACE_PERIOD_EXCEEDS_MONTHLY_TESTS : ( arg1 : { link : string , usedTestsMessage : string , gracePeriodMessage : string , limit : number } ) => {
1025
+ FREE_PLAN_IN_GRACE_PERIOD_EXCEEDS_MONTHLY_TESTS : ( arg1 : { link : string , usedTestsMessage : string , gracePeriodMessage : string , limit : number } ) => {
1028
1026
return errTemplate `\
1029
1027
You've exceeded the limit of test results under your free plan this month. ${ getUsedTestsMessage ( arg1 . limit , arg1 . usedTestsMessage ) }
1030
1028
@@ -1034,39 +1032,39 @@ export const AllCypressErrors = {
1034
1032
1035
1033
${ fmt . off ( arg1 . link ) } `
1036
1034
} ,
1037
- PLAN_EXCEEDS_MONTHLY_TESTS : ( arg1 : { link : string , planType : string , usedTestsMessage : string , limit : number } ) => {
1035
+ PLAN_EXCEEDS_MONTHLY_TESTS : ( arg1 : { link : string , planType : string , usedTestsMessage : string , limit : number } ) => {
1038
1036
return errTemplate `\
1039
1037
You've exceeded the limit of test results under your ${ fmt . highlight ( arg1 . planType ) } billing plan this month. ${ getUsedTestsMessage ( arg1 . limit , arg1 . usedTestsMessage ) }
1040
1038
1041
1039
To continue getting the full benefits of your current plan, please visit your billing to upgrade.
1042
1040
1043
1041
${ fmt . off ( arg1 . link ) } `
1044
1042
} ,
1045
- FREE_PLAN_IN_GRACE_PERIOD_PARALLEL_FEATURE : ( arg1 : { link : string , gracePeriodMessage : string } ) => {
1043
+ FREE_PLAN_IN_GRACE_PERIOD_PARALLEL_FEATURE : ( arg1 : { link : string , gracePeriodMessage : string } ) => {
1046
1044
return errTemplate `\
1047
1045
${ fmt . highlightSecondary ( `Parallelization` ) } is not included under your free plan.
1048
1046
1049
1047
Your plan is now in a grace period, which means your tests will still run in parallel until ${ fmt . highlight ( arg1 . gracePeriodMessage ) } . Please upgrade your plan to continue running your tests in parallel in the future.
1050
1048
1051
1049
${ fmt . off ( arg1 . link ) } `
1052
1050
} ,
1053
- PARALLEL_FEATURE_NOT_AVAILABLE_IN_PLAN : ( arg1 : { link : string } ) => {
1051
+ PARALLEL_FEATURE_NOT_AVAILABLE_IN_PLAN : ( arg1 : { link : string } ) => {
1054
1052
return errTemplate `\
1055
1053
${ fmt . highlightSecondary ( `Parallelization` ) } is not included under your current billing plan.
1056
1054
1057
1055
To run your tests in parallel, please visit your billing and upgrade to another plan with parallelization.
1058
1056
1059
1057
${ fmt . off ( arg1 . link ) } `
1060
1058
} ,
1061
- PLAN_IN_GRACE_PERIOD_RUN_GROUPING_FEATURE_USED : ( arg1 : { link : string , gracePeriodMessage : string } ) => {
1059
+ PLAN_IN_GRACE_PERIOD_RUN_GROUPING_FEATURE_USED : ( arg1 : { link : string , gracePeriodMessage : string } ) => {
1062
1060
return errTemplate `\
1063
1061
${ fmt . highlightSecondary ( `Grouping` ) } is not included under your free plan.
1064
1062
1065
1063
Your plan is now in a grace period, which means your tests will still run with groups until ${ fmt . highlight ( arg1 . gracePeriodMessage ) } . Please upgrade your plan to continue running your tests with groups in the future.
1066
1064
1067
1065
${ fmt . off ( arg1 . link ) } `
1068
1066
} ,
1069
- RUN_GROUPING_FEATURE_NOT_AVAILABLE_IN_PLAN : ( arg1 : { link : string } ) => {
1067
+ RUN_GROUPING_FEATURE_NOT_AVAILABLE_IN_PLAN : ( arg1 : { link : string } ) => {
1070
1068
return errTemplate `\
1071
1069
${ fmt . highlightSecondary ( `Grouping` ) } is not included under your current billing plan.
1072
1070
@@ -1113,7 +1111,7 @@ export const AllCypressErrors = {
1113
1111
1114
1112
CYPRESS_INTERNAL_ENV is reserved for internal use and cannot be modified.`
1115
1113
} ,
1116
- CDP_VERSION_TOO_OLD : ( minimumVersion : string , currentVersion : { major : number , minor : string | number } ) => {
1114
+ CDP_VERSION_TOO_OLD : ( minimumVersion : string , currentVersion : { major : number , minor : string | number } ) => {
1117
1115
const phrase = currentVersion . major !== 0
1118
1116
? fmt . highlight ( `${ currentVersion . major } .${ currentVersion . minor } ` )
1119
1117
: fmt . off ( 'an older version' )
@@ -1636,7 +1634,7 @@ interface GenericError extends Error {
1636
1634
[ key : string ] : any
1637
1635
}
1638
1636
1639
- export const cloneErr = function ( err : CypressError | GenericError , options : { html ?: boolean } = { } ) {
1637
+ export const cloneErr = function ( err : CypressError | GenericError , options : { html ?: boolean } = { } ) {
1640
1638
_ . defaults ( options , {
1641
1639
html : false ,
1642
1640
} )
0 commit comments