File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " @yinxulai/database-backup" ,
3- "version" : " 0.3.5 " ,
3+ "version" : " 0.3.6 " ,
44 "description" : " Multi-mode database backup tool with CI-first architecture" ,
55 "type" : " module" ,
66 "bin" : {
Original file line number Diff line number Diff line change @@ -85,6 +85,21 @@ describe('S3StorageDriver', () => {
8585 expect ( typeof driver . delete ) . toBe ( 'function' )
8686 expect ( typeof driver . list ) . toBe ( 'function' )
8787 } )
88+
89+ it ( 'should configure the S3 client for streaming uploads' , async ( ) => {
90+ const driver = new S3StorageDriver ( mockConfig )
91+ const internalDriver = driver as unknown as {
92+ client : {
93+ config : {
94+ requestChecksumCalculation ?: ( ) => Promise < string >
95+ responseChecksumValidation ?: ( ) => Promise < string >
96+ }
97+ }
98+ }
99+
100+ await expect ( internalDriver . client . config . requestChecksumCalculation ?.( ) ) . resolves . toBe ( 'WHEN_REQUIRED' )
101+ await expect ( internalDriver . client . config . responseChecksumValidation ?.( ) ) . resolves . toBe ( 'WHEN_REQUIRED' )
102+ } )
88103 } )
89104
90105 describe ( 'upload' , ( ) => {
Original file line number Diff line number Diff line change @@ -37,6 +37,8 @@ export class S3StorageDriver implements StorageDriver {
3737 secretAccessKey : config . secretAccessKey ,
3838 } ,
3939 forcePathStyle : config . forcePathStyle ,
40+ requestChecksumCalculation : 'WHEN_REQUIRED' ,
41+ responseChecksumValidation : 'WHEN_REQUIRED' ,
4042 } )
4143 this . logger = logger ?? createLogger ( )
4244 }
You can’t perform that action at this time.
0 commit comments