File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -528,6 +528,26 @@ describe("capabilityHelper.js", () => {
528
528
} ) ;
529
529
} ) ;
530
530
531
+ it ( "validate default bsConfig.auth" , ( ) => {
532
+ bsConfig = {
533
+ auth : {
534
+ username : "<Your BrowserStack username>" ,
535
+ access_key : "<Your BrowserStack access key>"
536
+ }
537
+ } ;
538
+ return capabilityHelper
539
+ . validate ( bsConfig , { parallels : undefined } )
540
+ . then ( function ( data ) {
541
+ chai . assert . fail ( "Promise error" ) ;
542
+ } )
543
+ . catch ( ( error ) => {
544
+ chai . assert . equal (
545
+ error ,
546
+ Constants . validationMessages . INVALID_DEFAULT_AUTH_PARAMS
547
+ ) ;
548
+ } ) ;
549
+ } ) ;
550
+
531
551
it ( "validate bsConfig.browsers" , ( ) => {
532
552
let bsConfig = {
533
553
auth : { } ,
Original file line number Diff line number Diff line change @@ -26,6 +26,11 @@ describe("utils", () => {
26
26
expect ( utils . getErrorCodeFromMsg ( constant . validationMessages . EMPTY_BROWSER_LIST ) ) . to . eq ( "bstack_json_invalid_no_browsers" ) ;
27
27
expect ( utils . getErrorCodeFromMsg ( constant . validationMessages . EMPTY_RUN_SETTINGS ) ) . to . eq ( "bstack_json_invalid_no_run_settings" ) ;
28
28
expect ( utils . getErrorCodeFromMsg ( constant . validationMessages . EMPTY_SPEC_FILES ) ) . to . eq ( "bstack_json_invalid_values" ) ;
29
+ expect ( utils . getErrorCodeFromMsg ( constant . validationMessages . INVALID_DEFAULT_AUTH_PARAMS ) ) . to . eq ( "bstack_json_default_auth_keys" ) ;
30
+ expect ( utils . getErrorCodeFromMsg ( constant . validationMessages . INVALID_PARALLELS_CONFIGURATION ) ) . to . eq ( "invalid_parallels_specified" ) ;
31
+ expect ( utils . getErrorCodeFromMsg ( constant . validationMessages . LOCAL_NOT_SET ) ) . to . eq ( "cypress_json_base_url_no_local" ) ;
32
+ expect ( utils . getErrorCodeFromMsg ( constant . validationMessages . INCORRECT_DIRECTORY_STRUCTURE ) ) . to . eq ( "invalid_directory_structure" ) ;
33
+ expect ( utils . getErrorCodeFromMsg ( "Please use --config-file <path to browserstack.json>." ) ) . to . eq ( "bstack_json_path_invalid" ) ;
29
34
} ) ;
30
35
} ) ;
31
36
You can’t perform that action at this time.
0 commit comments