@@ -2502,12 +2502,6 @@ describe('utils', () => {
2502
2502
let globStub = sinon . stub ( glob , 'sync' )
2503
2503
globStub . withArgs ( 'cypress/e2e/foo*.js' )
2504
2504
. returns ( [ 'cypress/e2e/foo_1.js' ] ) ;
2505
- // globStub.withArgs(`cypress/e2e/**/*.+(${constant.specFileTypes.join('|')})`)
2506
- // .returns([
2507
- // 'cypress/e2e/foo_1.js',
2508
- // 'cypress/e2e/foo_2.js',
2509
- // 'cypress/e2e/bar_1.js'
2510
- // ]);
2511
2505
let bsConfig = {
2512
2506
run_settings : {
2513
2507
cypressTestSuiteType : 'CYPRESS_V10_AND_ABOVE_TYPE' ,
@@ -2528,7 +2522,7 @@ describe('utils', () => {
2528
2522
glob . sync . restore ( ) ;
2529
2523
} ) ;
2530
2524
2531
- it ( 'should return under default folder if cypress v >= 10 and error while reading config file' , ( ) => {
2525
+ it ( 'should return files under default e2e folder if cypress v >= 10 and error while reading config file' , ( ) => {
2532
2526
let globStub = sinon . stub ( glob , 'sync' )
2533
2527
globStub . withArgs ( `cypress/e2e/**/*.+(${ constant . specFileTypes . join ( '|' ) } )` )
2534
2528
. returns ( [
@@ -2554,6 +2548,37 @@ describe('utils', () => {
2554
2548
} )
2555
2549
glob . sync . restore ( ) ;
2556
2550
} ) ;
2551
+
2552
+ it ( 'should return files under integration folder if cypress v >= 10, no spec arg in bstack.json and error while reading config file and no files under cypress/e2e' , ( ) => {
2553
+ let globStub = sinon . stub ( glob , 'sync' )
2554
+ globStub . withArgs ( `cypress/e2e/**/*.+(${ constant . specFileTypes . join ( '|' ) } )` )
2555
+ . returns ( [ ] ) ;
2556
+ globStub . withArgs ( `cypress/integration/**/*.+(${ constant . specFileTypes . join ( '|' ) } )` )
2557
+ . returns ( [
2558
+ 'cypress/integration/foo_1.js' ,
2559
+ 'cypress/integration/foo_2.js' ,
2560
+ 'cypress/integration/bar_1.js'
2561
+ ] ) ;
2562
+ let bsConfig = {
2563
+ run_settings : {
2564
+ cypressTestSuiteType : 'CYPRESS_V10_AND_ABOVE_TYPE' ,
2565
+ cypressProjectDir : 'cypressProjectDir' ,
2566
+ exclude : 'exclude' ,
2567
+ } ,
2568
+ } ;
2569
+
2570
+ const result = utils . getNumberOfSpecFiles ( bsConfig , { } , null ) ;
2571
+ expect ( result . length ) . to . eql ( 3 ) ;
2572
+ expect ( result [ 0 ] . endsWith ( 'cypress/integration/foo_1.js' ) ) . to . eql ( true ) ;
2573
+ expect ( result [ 1 ] . endsWith ( 'cypress/integration/foo_2.js' ) ) . to . eql ( true ) ;
2574
+ expect ( result [ 2 ] . endsWith ( 'cypress/integration/bar_1.js' ) ) . to . eql ( true ) ;
2575
+ sinon . assert . calledWithExactly ( globStub , `cypress/e2e/**/*.+(${ constant . specFileTypes . join ( '|' ) } )` , {
2576
+ cwd : 'cypressProjectDir' ,
2577
+ matchBase : true ,
2578
+ ignore : 'exclude' ,
2579
+ } )
2580
+ glob . sync . restore ( ) ;
2581
+ } ) ;
2557
2582
} ) ;
2558
2583
2559
2584
describe ( 'warnSpecLimit' , ( ) => {
0 commit comments