File tree 2 files changed +20
-1
lines changed
2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ module.exports = function run(args) {
122
122
123
123
// display browserstack.json is not valid only if validation of browserstack.json field has failed, otherwise display just the error message
124
124
// If parallels specified in arguments are invalid do not display browserstack.json is invalid message
125
- if ( ! ( err === Constants . validationMessages . INVALID_PARALLELS_CONFIGURATION && ! utils . isUndefined ( args . parallels ) ) ) {
125
+ if ( utils . isJSONInvalid ( err , args ) ) {
126
126
logger . error ( Constants . validationMessages . NOT_VALID ) ;
127
127
}
128
128
Original file line number Diff line number Diff line change @@ -380,3 +380,22 @@ exports.versionChangedMessage = (preferredVersion, actualVersion) => {
380
380
message = message . replace ( "<actualVersion>" , actualVersion ) ;
381
381
return message
382
382
}
383
+
384
+ exports . isJSONInvalid = ( err , args ) => {
385
+ let invalid = true
386
+
387
+ if ( err === Constants . validationMessages . INVALID_PARALLELS_CONFIGURATION && ! this . isUndefined ( args . parallels ) ) {
388
+ invalid = false
389
+ }
390
+
391
+ if ( this . deleteBaseUrlFromError ( err ) === this . deleteBaseUrlFromError ( Constants . validationMessages . LOCAL_NOT_SET ) ) {
392
+ invalid = false
393
+ }
394
+
395
+ return invalid
396
+ }
397
+
398
+ exports . deleteBaseUrlFromError = ( err ) => {
399
+ return err . replace ( / T o t e s t ( [ \s \S ] * ) o n B r o w s e r S t a c k / g, 'To test on BrowserStack' ) ;
400
+ }
401
+
You can’t perform that action at this time.
0 commit comments