@@ -105,7 +105,7 @@ describe("utils", () => {
105
105
"parallels" : 10 ,
106
106
}
107
107
} ;
108
- utils . setParallels ( bsConfig , { parallels : 100 } ) ;
108
+ utils . setParallels ( bsConfig , { parallels : 100 } ) ;
109
109
expect ( bsConfig [ 'run_settings' ] [ 'parallels' ] ) . to . be . eq ( 100 ) ;
110
110
} ) ;
111
111
@@ -115,7 +115,7 @@ describe("utils", () => {
115
115
"parallels" : 10 ,
116
116
}
117
117
} ;
118
- utils . setParallels ( bsConfig , { parallels : undefined } ) ;
118
+ utils . setParallels ( bsConfig , { parallels : undefined } ) ;
119
119
expect ( bsConfig [ 'run_settings' ] [ 'parallels' ] ) . to . be . eq ( 10 ) ;
120
120
} ) ;
121
121
} ) ;
@@ -126,8 +126,8 @@ describe("utils", () => {
126
126
} ) ;
127
127
128
128
it ( `should return value depending on validation messages` , ( ) => {
129
- expect ( utils . getErrorCodeFromErr ( { "code" : "SyntaxError" } ) ) . to . eq ( "bstack_json_parse_error" ) ;
130
- expect ( utils . getErrorCodeFromErr ( { "code" : "EACCES" } ) ) . to . eq ( "bstack_json_no_permission" ) ;
129
+ expect ( utils . getErrorCodeFromErr ( { "code" : "SyntaxError" } ) ) . to . eq ( "bstack_json_parse_error" ) ;
130
+ expect ( utils . getErrorCodeFromErr ( { "code" : "EACCES" } ) ) . to . eq ( "bstack_json_no_permission" ) ;
131
131
} ) ;
132
132
} ) ;
133
133
@@ -139,15 +139,15 @@ describe("utils", () => {
139
139
140
140
describe ( "validateBstackJson" , ( ) => {
141
141
it ( "should reject with SyntaxError for empty file" , ( ) => {
142
- let bsConfigPath = path . join ( process . cwd ( ) , 'test' , 'test_files' , 'dummy_bstack.json' ) ;
142
+ let bsConfigPath = path . join ( process . cwd ( ) , 'test' , 'test_files' , 'dummy_bstack.json' ) ;
143
143
expect ( utils . validateBstackJson ( bsConfigPath ) ) . to . be . rejectedWith ( SyntaxError ) ;
144
144
} ) ;
145
145
it ( "should resolve with data for valid json" , ( ) => {
146
- let bsConfigPath = path . join ( process . cwd ( ) , 'test' , 'test_files' , 'dummy_bstack_2.json' ) ;
146
+ let bsConfigPath = path . join ( process . cwd ( ) , 'test' , 'test_files' , 'dummy_bstack_2.json' ) ;
147
147
expect ( utils . validateBstackJson ( bsConfigPath ) ) . to . be . eventually . eql ( { } ) ;
148
148
} ) ;
149
149
it ( "should reject with SyntaxError for invalid json file" , ( ) => {
150
- let bsConfigPath = path . join ( process . cwd ( ) , 'test' , 'test_files' , 'dummy_bstack_3.json' ) ;
150
+ let bsConfigPath = path . join ( process . cwd ( ) , 'test' , 'test_files' , 'dummy_bstack_3.json' ) ;
151
151
expect ( utils . validateBstackJson ( bsConfigPath ) ) . to . be . rejectedWith ( SyntaxError ) ;
152
152
} ) ;
153
153
} ) ;
@@ -271,18 +271,18 @@ describe("utils", () => {
271
271
fs . unlink . restore ( ) ;
272
272
} ) ;
273
273
} ) ;
274
-
274
+
275
275
describe ( "isCypressProjDirValid" , ( ) => {
276
- it ( "should return true when cypressDir and cypressProjDir is same" , ( ) => {
277
- expect ( utils . isCypressProjDirValid ( "/absolute/path" , "/absolute/path" ) ) . to . be . true ;
276
+ it ( "should return true when cypressDir and cypressProjDir is same" , ( ) => {
277
+ expect ( utils . isCypressProjDirValid ( "/absolute/path" , "/absolute/path" ) ) . to . be . true ;
278
278
} ) ;
279
279
280
- it ( "should return true when cypressProjDir is child directory of cypressDir" , ( ) => {
281
- expect ( utils . isCypressProjDirValid ( "/absolute/path" , "/absolute/path/childpath" ) ) . to . be . true ;
280
+ it ( "should return true when cypressProjDir is child directory of cypressDir" , ( ) => {
281
+ expect ( utils . isCypressProjDirValid ( "/absolute/path" , "/absolute/path/childpath" ) ) . to . be . true ;
282
282
} ) ;
283
283
284
- it ( "should return false when cypressProjDir is not child directory of cypressDir" , ( ) => {
285
- expect ( utils . isCypressProjDirValid ( "/absolute/path" , "/absolute" ) ) . to . be . false ;
284
+ it ( "should return false when cypressProjDir is not child directory of cypressDir" , ( ) => {
285
+ expect ( utils . isCypressProjDirValid ( "/absolute/path" , "/absolute" ) ) . to . be . false ;
286
286
} ) ;
287
287
} ) ;
288
288
@@ -296,14 +296,14 @@ describe("utils", () => {
296
296
} ) ;
297
297
298
298
it ( "should return false if connectionSettings.local is false" , ( ) => {
299
- expect ( utils . getLocalFlag ( { "local" : false } ) ) . to . be . false ;
299
+ expect ( utils . getLocalFlag ( { "local" : false } ) ) . to . be . false ;
300
300
} ) ;
301
301
302
302
it ( "should return true if connectionSettings.local is true" , ( ) => {
303
- expect ( utils . getLocalFlag ( { "local" : true } ) ) . to . be . true ;
303
+ expect ( utils . getLocalFlag ( { "local" : true } ) ) . to . be . true ;
304
304
} ) ;
305
305
} ) ;
306
-
306
+
307
307
describe ( "setLocal" , ( ) => {
308
308
beforeEach ( function ( ) {
309
309
delete process . env . BROWSERSTACK_LOCAL ;
@@ -408,34 +408,34 @@ describe("utils", () => {
408
408
delete process . env . BROWSERSTACK_USERNAME ;
409
409
} ) ;
410
410
411
- it ( "should set username if args.username is present" , ( ) => {
411
+ it ( "should set username if args.username is present" , ( ) => {
412
412
let bsConfig = {
413
413
auth : {
414
414
username : "test"
415
415
}
416
416
}
417
- utils . setUsername ( bsConfig , { username : "username" } ) ;
417
+ utils . setUsername ( bsConfig , { username : "username" } ) ;
418
418
expect ( bsConfig . auth . username ) . to . be . eq ( "username" ) ;
419
419
} ) ;
420
420
421
- it ( "should set username if process.env.BROWSERSTACK_USERNAME is present and args.username is not present" , ( ) => {
421
+ it ( "should set username if process.env.BROWSERSTACK_USERNAME is present and args.username is not present" , ( ) => {
422
422
let bsConfig = {
423
423
auth : {
424
424
username : "test"
425
425
}
426
426
}
427
427
process . env . BROWSERSTACK_USERNAME = "username"
428
- utils . setUsername ( bsConfig , { } ) ;
428
+ utils . setUsername ( bsConfig , { } ) ;
429
429
expect ( bsConfig . auth . username ) . to . be . eq ( "username" ) ;
430
430
} ) ;
431
431
432
- it ( "should set username to default if process.env.BROWSERSTACK_USERNAME and args.username is not present" , ( ) => {
432
+ it ( "should set username to default if process.env.BROWSERSTACK_USERNAME and args.username is not present" , ( ) => {
433
433
let bsConfig = {
434
434
auth : {
435
435
username : "test"
436
436
}
437
437
}
438
- utils . setUsername ( bsConfig , { } ) ;
438
+ utils . setUsername ( bsConfig , { } ) ;
439
439
expect ( bsConfig . auth . username ) . to . be . eq ( "test" ) ;
440
440
} ) ;
441
441
@@ -450,34 +450,34 @@ describe("utils", () => {
450
450
delete process . env . BROWSERSTACK_ACCESS_KEY ;
451
451
} ) ;
452
452
453
- it ( "should set access_key if args.key is present" , ( ) => {
453
+ it ( "should set access_key if args.key is present" , ( ) => {
454
454
let bsConfig = {
455
455
auth : {
456
456
access_key : "test"
457
457
}
458
458
}
459
- utils . setAccessKey ( bsConfig , { key : "access_key" } ) ;
459
+ utils . setAccessKey ( bsConfig , { key : "access_key" } ) ;
460
460
expect ( bsConfig . auth . access_key ) . to . be . eq ( "access_key" ) ;
461
461
} ) ;
462
462
463
- it ( "should set access_key if process.env.BROWSERSTACK_ACCESS_KEY is present and args.access_key is not present" , ( ) => {
463
+ it ( "should set access_key if process.env.BROWSERSTACK_ACCESS_KEY is present and args.access_key is not present" , ( ) => {
464
464
let bsConfig = {
465
465
auth : {
466
466
access_key : "test"
467
467
}
468
468
}
469
469
process . env . BROWSERSTACK_ACCESS_KEY = "access_key"
470
- utils . setAccessKey ( bsConfig , { } ) ;
470
+ utils . setAccessKey ( bsConfig , { } ) ;
471
471
expect ( bsConfig . auth . access_key ) . to . be . eq ( "access_key" ) ;
472
472
} ) ;
473
473
474
- it ( "should set access_key to default if process.env.BROWSERSTACK_ACCESS_KEY and args.access_key is not present" , ( ) => {
474
+ it ( "should set access_key to default if process.env.BROWSERSTACK_ACCESS_KEY and args.access_key is not present" , ( ) => {
475
475
let bsConfig = {
476
476
auth : {
477
477
access_key : "test"
478
478
}
479
479
}
480
- utils . setAccessKey ( bsConfig , { } ) ;
480
+ utils . setAccessKey ( bsConfig , { } ) ;
481
481
expect ( bsConfig . auth . access_key ) . to . be . eq ( "test" ) ;
482
482
} ) ;
483
483
0 commit comments