@@ -44,10 +44,10 @@ const bucket = 'bucket';
44
44
const region = 'region' ;
45
45
const defaultKey = 'key' ;
46
46
const defaultContentType = 'application/octet-stream' ;
47
- const defaultCacheKey =
48
- 'o6a/Qw== _8388608_application/octet-stream_bucket_public_key' ;
47
+ const emptyOptionHash = 'o6a/Qw==' ; // crc32 for '{}'
48
+ const defaultCacheKey = ` ${ emptyOptionHash } _8388608_application/octet-stream_bucket_public_key` ;
49
49
const testPath = 'testPath/object' ;
50
- const testPathCacheKey = `o6a/Qw== _8388608_${ defaultContentType } _${ bucket } _custom_${ testPath } ` ;
50
+ const testPathCacheKey = `${ emptyOptionHash } _8388608_${ defaultContentType } _${ bucket } _custom_${ testPath } ` ;
51
51
52
52
const mockCreateMultipartUpload = jest . mocked ( createMultipartUpload ) ;
53
53
const mockUploadPart = jest . mocked ( uploadPart ) ;
@@ -545,7 +545,7 @@ describe('getMultipartUploadHandlers with key', () => {
545
545
describe ( 'cache validation' , ( ) => {
546
546
it . each ( [
547
547
{
548
- name : 'mismatch part count between cached upload and actual upload' ,
548
+ name : 'mismatched part count between cached upload and actual upload' ,
549
549
parts : [ { PartNumber : 1 } , { PartNumber : 2 } , { PartNumber : 3 } ] ,
550
550
} ,
551
551
{
@@ -693,7 +693,7 @@ describe('getMultipartUploadHandlers with key', () => {
693
693
expect ( Object . keys ( cacheValue ) ) . toEqual ( [
694
694
expect . stringMatching (
695
695
// \d{13} is the file lastModified property of a file
696
- / s o m e N a m e _ \d { 13 } _ o 6 a \/ Q w = = _ 8 3 8 8 6 0 8 _ a p p l i c a t i o n \/ o c t e t - s t r e a m _ b u c k e t _ p u b l i c _ k e y / ,
696
+ new RegExp ( ` someName_\\ d{13}_ ${ defaultCacheKey } ` ) ,
697
697
) ,
698
698
] ) ;
699
699
} ) ;
0 commit comments