@@ -397,6 +397,7 @@ describe("runs", () => {
397
397
setConfigStub = sandbox . stub ( ) ;
398
398
setBrowsersStub = sandbox . stub ( ) ;
399
399
setCLIModeStub = sandbox . stub ( ) ;
400
+ fetchZipSizeStub = sandbox . stub ( ) ;
400
401
} ) ;
401
402
402
403
afterEach ( ( ) => {
@@ -438,7 +439,8 @@ describe("runs", () => {
438
439
setLocalConfigFile : setLocalConfigFileStub ,
439
440
setBrowsers : setBrowsersStub ,
440
441
setConfig : setConfigStub ,
441
- setCLIMode : setCLIModeStub
442
+ setCLIMode : setCLIModeStub ,
443
+ fetchZipSize : fetchZipSizeStub ,
442
444
} ,
443
445
'../helpers/capabilityHelper' : {
444
446
validate : capabilityValidatorStub ,
@@ -468,6 +470,7 @@ describe("runs", () => {
468
470
packageInstallerStub . returns ( Promise . resolve ( { packageArchieveCreated : false } ) ) ;
469
471
archiverStub . returns ( Promise . resolve ( "Zipping completed" ) ) ;
470
472
zipUploadStub . returns ( Promise . reject ( "random-error" ) ) ;
473
+ fetchZipSizeStub . returns ( 123 ) ;
471
474
472
475
return runs ( args )
473
476
. then ( function ( _bsConfig ) {
@@ -476,6 +479,7 @@ describe("runs", () => {
476
479
. catch ( ( error ) => {
477
480
sinon . assert . calledOnce ( getConfigPathStub ) ;
478
481
sinon . assert . calledOnce ( getConfigPathStub ) ;
482
+ sinon . assert . calledTwice ( fetchZipSizeStub ) ;
479
483
sinon . assert . calledOnce ( setLocalModeStub ) ;
480
484
sinon . assert . calledOnce ( setLocalConfigFileStub ) ;
481
485
sinon . assert . calledOnce ( getNumberOfSpecFilesStub ) ;
@@ -555,6 +559,7 @@ describe("runs", () => {
555
559
setConfigStub = sandbox . stub ( ) ;
556
560
setBrowsersStub = sandbox . stub ( ) ;
557
561
setCLIModeStub = sandbox . stub ( ) ;
562
+ fetchZipSizeStub = sandbox . stub ( ) ;
558
563
} ) ;
559
564
560
565
afterEach ( ( ) => {
@@ -597,7 +602,8 @@ describe("runs", () => {
597
602
setLocalConfigFile : setLocalConfigFileStub ,
598
603
setBrowsers : setBrowsersStub ,
599
604
setConfig : setConfigStub ,
600
- setCLIMode : setCLIModeStub
605
+ setCLIMode : setCLIModeStub ,
606
+ fetchZipSize : fetchZipSizeStub ,
601
607
} ,
602
608
'../helpers/capabilityHelper' : {
603
609
validate : capabilityValidatorStub ,
@@ -634,6 +640,7 @@ describe("runs", () => {
634
640
zipUploadStub . returns ( Promise . resolve ( "zip uploaded" ) ) ;
635
641
stopLocalBinaryStub . returns ( Promise . resolve ( "nothing" ) ) ;
636
642
createBuildStub . returns ( Promise . reject ( "random-error" ) ) ;
643
+ fetchZipSizeStub . returns ( 123 ) ;
637
644
638
645
return runs ( args )
639
646
. then ( function ( _bsConfig ) {
@@ -642,6 +649,7 @@ describe("runs", () => {
642
649
. catch ( ( error ) => {
643
650
sinon . assert . calledOnce ( getConfigPathStub ) ;
644
651
sinon . assert . calledOnce ( getConfigPathStub ) ;
652
+ sinon . assert . calledTwice ( fetchZipSizeStub ) ;
645
653
sinon . assert . calledOnce ( setLocalConfigFileStub ) ;
646
654
sinon . assert . calledOnce ( setLocalModeStub ) ;
647
655
sinon . assert . calledOnce ( setupLocalTestingStub ) ;
@@ -706,6 +714,9 @@ describe("runs", () => {
706
714
return "end" ;
707
715
} ) ;
708
716
dashboardUrl = "dashboard-url" ;
717
+ packageDirName = "package-dir" ;
718
+ packageFileName = "package-file" ;
719
+ fileName = "file-name" ;
709
720
capabilityValidatorStub = sandbox . stub ( ) ;
710
721
archiverStub = sandbox . stub ( ) ;
711
722
zipUploadStub = sandbox . stub ( ) ;
@@ -736,6 +747,7 @@ describe("runs", () => {
736
747
nonEmptyArrayStub = sandbox . stub ( ) ;
737
748
setCLIModeStub = sandbox . stub ( ) ;
738
749
setProcessHooksStub = sandbox . stub ( ) ;
750
+ fetchZipSizeStub = sandbox . stub ( ) ;
739
751
} ) ;
740
752
741
753
afterEach ( ( ) => {
@@ -748,7 +760,7 @@ describe("runs", () => {
748
760
let errorCode = null ;
749
761
let message = `Success! ${ Constants . userMessages . BUILD_CREATED } with build id: random_build_id` ;
750
762
let dashboardLink = `${ Constants . userMessages . VISIT_DASHBOARD } ${ dashboardUrl } ` ;
751
- let data = { user_id : 1234 , parallels : 10 , time_components : { } , unique_id : 'random_hash' , package_error : 'test' , checkmd5_error : 'test' , build_id : 'random_build_id' }
763
+ let data = { user_id : 1234 , parallels : 10 , time_components : { } , unique_id : 'random_hash' , package_error : 'test' , checkmd5_error : 'test' , build_id : 'random_build_id' , test_zip_size : 123 , npm_zip_size : 123 }
752
764
753
765
const runs = proxyquire ( '../../../../bin/commands/runs' , {
754
766
'../helpers/utils' : {
@@ -786,7 +798,8 @@ describe("runs", () => {
786
798
nonEmptyArray : nonEmptyArrayStub ,
787
799
checkError : checkErrorStub ,
788
800
setCLIMode : setCLIModeStub ,
789
- setProcessHooks : setProcessHooksStub
801
+ setProcessHooks : setProcessHooksStub ,
802
+ fetchZipSize : fetchZipSizeStub ,
790
803
} ,
791
804
'../helpers/capabilityHelper' : {
792
805
validate : capabilityValidatorStub ,
@@ -806,6 +819,9 @@ describe("runs", () => {
806
819
} ,
807
820
'../helpers/config' : {
808
821
dashboardUrl : dashboardUrl ,
822
+ packageDirName : packageDirName ,
823
+ packageFileName : packageFileName ,
824
+ fileName : fileName ,
809
825
} ,
810
826
'../helpers/checkUploaded' : {
811
827
checkUploadedMd5 : checkUploadedStub ,
@@ -836,6 +852,7 @@ describe("runs", () => {
836
852
checkErrorStub . returns ( 'test' ) ;
837
853
getParallelsStub . returns ( 10 ) ;
838
854
createBuildStub . returns ( Promise . resolve ( { message : 'Success' , build_id : 'random_build_id' , dashboard_url : dashboardUrl , user_id : 1234 } ) ) ;
855
+ fetchZipSizeStub . returns ( 123 ) ;
839
856
840
857
return runs ( args )
841
858
. then ( function ( _bsConfig ) {
@@ -851,6 +868,7 @@ describe("runs", () => {
851
868
sinon . assert . calledOnce ( getParallelsStub ) ;
852
869
sinon . assert . calledOnce ( setParallelsStub ) ;
853
870
sinon . assert . calledOnce ( warnSpecLimitStub ) ;
871
+ sinon . assert . calledTwice ( fetchZipSizeStub ) ;
854
872
sinon . assert . calledOnce ( setLocalStub ) ;
855
873
sinon . assert . calledOnce ( setLocalModeStub ) ;
856
874
sinon . assert . calledOnce ( setupLocalTestingStub ) ;
0 commit comments