@@ -391,6 +391,7 @@ describe("runs", () => {
391
391
setConfigStub = sandbox . stub ( ) ;
392
392
setBrowsersStub = sandbox . stub ( ) ;
393
393
setCLIModeStub = sandbox . stub ( ) ;
394
+ fetchZipSizeStub = sandbox . stub ( ) ;
394
395
} ) ;
395
396
396
397
afterEach ( ( ) => {
@@ -431,7 +432,8 @@ describe("runs", () => {
431
432
setLocalConfigFile : setLocalConfigFileStub ,
432
433
setBrowsers : setBrowsersStub ,
433
434
setConfig : setConfigStub ,
434
- setCLIMode : setCLIModeStub
435
+ setCLIMode : setCLIModeStub ,
436
+ fetchZipSize : fetchZipSizeStub ,
435
437
} ,
436
438
'../helpers/capabilityHelper' : {
437
439
validate : capabilityValidatorStub ,
@@ -461,6 +463,7 @@ describe("runs", () => {
461
463
packageInstallerStub . returns ( Promise . resolve ( { packageArchieveCreated : false } ) ) ;
462
464
archiverStub . returns ( Promise . resolve ( "Zipping completed" ) ) ;
463
465
zipUploadStub . returns ( Promise . reject ( "random-error" ) ) ;
466
+ fetchZipSizeStub . returns ( 123 ) ;
464
467
465
468
return runs ( args )
466
469
. then ( function ( _bsConfig ) {
@@ -469,6 +472,7 @@ describe("runs", () => {
469
472
. catch ( ( error ) => {
470
473
sinon . assert . calledOnce ( getConfigPathStub ) ;
471
474
sinon . assert . calledOnce ( getConfigPathStub ) ;
475
+ sinon . assert . calledTwice ( fetchZipSizeStub ) ;
472
476
sinon . assert . calledOnce ( setLocalModeStub ) ;
473
477
sinon . assert . calledOnce ( setLocalConfigFileStub ) ;
474
478
sinon . assert . calledOnce ( getNumberOfSpecFilesStub ) ;
@@ -546,6 +550,7 @@ describe("runs", () => {
546
550
setConfigStub = sandbox . stub ( ) ;
547
551
setBrowsersStub = sandbox . stub ( ) ;
548
552
setCLIModeStub = sandbox . stub ( ) ;
553
+ fetchZipSizeStub = sandbox . stub ( ) ;
549
554
} ) ;
550
555
551
556
afterEach ( ( ) => {
@@ -587,7 +592,8 @@ describe("runs", () => {
587
592
setLocalConfigFile : setLocalConfigFileStub ,
588
593
setBrowsers : setBrowsersStub ,
589
594
setConfig : setConfigStub ,
590
- setCLIMode : setCLIModeStub
595
+ setCLIMode : setCLIModeStub ,
596
+ fetchZipSize : fetchZipSizeStub ,
591
597
} ,
592
598
'../helpers/capabilityHelper' : {
593
599
validate : capabilityValidatorStub ,
@@ -624,6 +630,7 @@ describe("runs", () => {
624
630
zipUploadStub . returns ( Promise . resolve ( "zip uploaded" ) ) ;
625
631
stopLocalBinaryStub . returns ( Promise . resolve ( "nothing" ) ) ;
626
632
createBuildStub . returns ( Promise . reject ( "random-error" ) ) ;
633
+ fetchZipSizeStub . returns ( 123 ) ;
627
634
628
635
return runs ( args )
629
636
. then ( function ( _bsConfig ) {
@@ -632,6 +639,7 @@ describe("runs", () => {
632
639
. catch ( ( error ) => {
633
640
sinon . assert . calledOnce ( getConfigPathStub ) ;
634
641
sinon . assert . calledOnce ( getConfigPathStub ) ;
642
+ sinon . assert . calledTwice ( fetchZipSizeStub ) ;
635
643
sinon . assert . calledOnce ( setLocalConfigFileStub ) ;
636
644
sinon . assert . calledOnce ( setLocalModeStub ) ;
637
645
sinon . assert . calledOnce ( setupLocalTestingStub ) ;
@@ -694,6 +702,9 @@ describe("runs", () => {
694
702
return "end" ;
695
703
} ) ;
696
704
dashboardUrl = "dashboard-url" ;
705
+ packageDirName = "package-dir" ;
706
+ packageFileName = "package-file" ;
707
+ fileName = "file-name" ;
697
708
capabilityValidatorStub = sandbox . stub ( ) ;
698
709
archiverStub = sandbox . stub ( ) ;
699
710
zipUploadStub = sandbox . stub ( ) ;
@@ -724,6 +735,7 @@ describe("runs", () => {
724
735
nonEmptyArrayStub = sandbox . stub ( ) ;
725
736
setCLIModeStub = sandbox . stub ( ) ;
726
737
setProcessHooksStub = sandbox . stub ( ) ;
738
+ fetchZipSizeStub = sandbox . stub ( ) ;
727
739
} ) ;
728
740
729
741
afterEach ( ( ) => {
@@ -736,7 +748,7 @@ describe("runs", () => {
736
748
let errorCode = null ;
737
749
let message = `Success! ${ Constants . userMessages . BUILD_CREATED } with build id: random_build_id` ;
738
750
let dashboardLink = `${ Constants . userMessages . VISIT_DASHBOARD } ${ dashboardUrl } ` ;
739
- let data = { time_components : { } , unique_id : 'random_hash' , package_error : 'test' , checkmd5_error : 'test' , build_id : 'random_build_id' }
751
+ let data = { 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 }
740
752
741
753
const runs = proxyquire ( '../../../../bin/commands/runs' , {
742
754
'../helpers/utils' : {
@@ -773,7 +785,8 @@ describe("runs", () => {
773
785
nonEmptyArray : nonEmptyArrayStub ,
774
786
checkError : checkErrorStub ,
775
787
setCLIMode : setCLIModeStub ,
776
- setProcessHooks : setProcessHooksStub
788
+ setProcessHooks : setProcessHooksStub ,
789
+ fetchZipSize : fetchZipSizeStub ,
777
790
} ,
778
791
'../helpers/capabilityHelper' : {
779
792
validate : capabilityValidatorStub ,
@@ -793,6 +806,9 @@ describe("runs", () => {
793
806
} ,
794
807
'../helpers/config' : {
795
808
dashboardUrl : dashboardUrl ,
809
+ packageDirName : packageDirName ,
810
+ packageFileName : packageFileName ,
811
+ fileName : fileName ,
796
812
} ,
797
813
'../helpers/checkUploaded' : {
798
814
checkUploadedMd5 : checkUploadedStub ,
@@ -821,6 +837,7 @@ describe("runs", () => {
821
837
stopLocalBinaryStub . returns ( Promise . resolve ( "nothing" ) ) ;
822
838
nonEmptyArrayStub . returns ( false ) ;
823
839
checkErrorStub . returns ( 'test' ) ;
840
+ fetchZipSizeStub . returns ( 123 ) ;
824
841
createBuildStub . returns ( Promise . resolve ( { message : 'Success' , build_id : 'random_build_id' , dashboard_url : dashboardUrl } ) ) ;
825
842
826
843
return runs ( args )
@@ -836,6 +853,7 @@ describe("runs", () => {
836
853
sinon . assert . calledOnce ( getNumberOfSpecFilesStub ) ;
837
854
sinon . assert . calledOnce ( setParallelsStub ) ;
838
855
sinon . assert . calledOnce ( warnSpecLimitStub ) ;
856
+ sinon . assert . calledTwice ( fetchZipSizeStub ) ;
839
857
sinon . assert . calledOnce ( setLocalStub ) ;
840
858
sinon . assert . calledOnce ( setLocalModeStub ) ;
841
859
sinon . assert . calledOnce ( setupLocalTestingStub ) ;
0 commit comments