@@ -46,14 +46,19 @@ describe('Unit Test uploadFile', function() {
4646
4747 it ( 'uploads a single file' , async function ( ) {
4848 const uploader = new UploadHelper ( new Storage ( ) ) ;
49- await uploader . uploadFile ( EXAMPLE_BUCKET , EXAMPLE_FILE ) ;
49+ await uploader . uploadFile ( EXAMPLE_BUCKET , EXAMPLE_FILE , true ) ;
5050 // Assert that upload method in storage library was called with right file.
5151 expect ( this . uploadStub . firstCall . args [ 0 ] ) . eq ( EXAMPLE_FILE ) ;
5252 } ) ;
5353
5454 it ( 'uploads a single file with prefix' , async function ( ) {
5555 const uploader = new UploadHelper ( new Storage ( ) ) ;
56- await uploader . uploadFile ( EXAMPLE_BUCKET , EXAMPLE_FILE , EXAMPLE_PREFIX ) ;
56+ await uploader . uploadFile (
57+ EXAMPLE_BUCKET ,
58+ EXAMPLE_FILE ,
59+ true ,
60+ EXAMPLE_PREFIX ,
61+ ) ;
5762 // Assert that upload method in storage library was called with right file
5863 // and right prefix.
5964 expect ( this . uploadStub . firstCall . args [ 0 ] ) . eq ( EXAMPLE_FILE ) ;
@@ -83,7 +88,7 @@ describe('Unit Test uploadDir', function() {
8388
8489 it ( 'uploads a dir' , async function ( ) {
8590 const uploader = new UploadHelper ( new Storage ( ) ) ;
86- await uploader . uploadDirectory ( EXAMPLE_BUCKET , EXAMPLE_DIR ) ;
91+ await uploader . uploadDirectory ( EXAMPLE_BUCKET , EXAMPLE_DIR , true ) ;
8792 // Assert that uploadFile was called for each file in directory.
8893 expect ( this . uploadFileStub . callCount ) . eq ( FILES_IN_DIR . length ) ;
8994 // Capture filename arguments passed to uploadFile.
@@ -97,7 +102,12 @@ describe('Unit Test uploadDir', function() {
97102
98103 it ( 'uploads a dir with prefix' , async function ( ) {
99104 const uploader = new UploadHelper ( new Storage ( ) ) ;
100- await uploader . uploadDirectory ( EXAMPLE_BUCKET , EXAMPLE_DIR , EXAMPLE_PREFIX ) ;
105+ await uploader . uploadDirectory (
106+ EXAMPLE_BUCKET ,
107+ EXAMPLE_DIR ,
108+ true ,
109+ EXAMPLE_PREFIX ,
110+ ) ;
101111 // Assert that uploadFile was called for each file in directory.
102112 expect ( this . uploadFileStub . callCount ) . eq ( FILES_IN_DIR . length ) ;
103113 // Capture filename arguments passed to uploadFile.
@@ -107,7 +117,7 @@ describe('Unit Test uploadDir', function() {
107117 ) ;
108118 // Capture destination arguments passed to uploadFile.
109119 const destinations = uploadFileCalls . map (
110- ( uploadFileCall : sinon . SinonSpyCall ) => uploadFileCall . args [ 2 ] ,
120+ ( uploadFileCall : sinon . SinonSpyCall ) => uploadFileCall . args [ 3 ] ,
111121 ) ;
112122 // Assert uploadDir called uploadFile with right files.
113123 expect ( filenames ) . to . have . members ( FILES_IN_DIR ) ;
0 commit comments