@@ -2019,7 +2019,6 @@ describe('File', () => {
2019
2019
const writable = file . createWriteStream ( options ) ;
2020
2020
2021
2021
file . startSimpleUpload_ = ( stream : { } , options_ : { } ) => {
2022
- assert . deepStrictEqual ( options_ , options ) ;
2023
2022
done ( ) ;
2024
2023
} ;
2025
2024
@@ -2034,7 +2033,6 @@ describe('File', () => {
2034
2033
const writable = file . createWriteStream ( options ) ;
2035
2034
2036
2035
file . startResumableUpload_ = ( stream : { } , options_ : { } ) => {
2037
- assert . deepStrictEqual ( options_ , options ) ;
2038
2036
done ( ) ;
2039
2037
} ;
2040
2038
@@ -2050,7 +2048,6 @@ describe('File', () => {
2050
2048
const writable = file . createWriteStream ( options ) ;
2051
2049
2052
2050
file . startResumableUpload_ = ( stream : { } , options_ : { } ) => {
2053
- assert . deepStrictEqual ( options_ , options ) ;
2054
2051
done ( ) ;
2055
2052
} ;
2056
2053
@@ -2170,7 +2167,6 @@ describe('File', () => {
2170
2167
} ) ;
2171
2168
2172
2169
file . startSimpleUpload_ = ( stream : Stream , _options : { } ) => {
2173
- assert . deepStrictEqual ( _options , options ) ;
2174
2170
done ( ) ;
2175
2171
} ;
2176
2172
@@ -2185,7 +2181,6 @@ describe('File', () => {
2185
2181
2186
2182
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2187
2183
file . startResumableUpload_ = ( stream : { } , options : any ) => {
2188
- assert . deepStrictEqual ( options . metadata , METADATA ) ;
2189
2184
done ( ) ;
2190
2185
} ;
2191
2186
@@ -2226,6 +2221,19 @@ describe('File', () => {
2226
2221
writable . write ( 'data' ) ;
2227
2222
} ) ;
2228
2223
2224
+ it ( 'should not overwrite passed in options' , done => {
2225
+ const emptyObject = { } ;
2226
+ const writable = file . createWriteStream ( emptyObject ) ;
2227
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2228
+ file . startResumableUpload_ = ( stream : { } , options : any ) => {
2229
+ assert . strictEqual ( options . metadata . contentType , 'image/png' ) ;
2230
+ assert . deepStrictEqual ( emptyObject , { } ) ;
2231
+ done ( ) ;
2232
+ } ;
2233
+
2234
+ writable . write ( 'data' ) ;
2235
+ } ) ;
2236
+
2229
2237
it ( 'should not set a contentType if mime lookup failed' , done => {
2230
2238
const file = new File ( 'file-without-ext' ) ;
2231
2239
const writable = file . createWriteStream ( ) ;
@@ -4829,7 +4837,7 @@ describe('File', () => {
4829
4837
assert . strictEqual ( opts . file , file . name ) ;
4830
4838
assert . strictEqual ( opts . generation , file . generation ) ;
4831
4839
assert . strictEqual ( opts . key , file . encryptionKey ) ;
4832
- assert . strictEqual ( opts . metadata , options . metadata ) ;
4840
+ assert . deepStrictEqual ( opts . metadata , options . metadata ) ;
4833
4841
assert . strictEqual ( opts . offset , options . offset ) ;
4834
4842
assert . strictEqual ( opts . predefinedAcl , options . predefinedAcl ) ;
4835
4843
assert . strictEqual ( opts . private , options . private ) ;
@@ -4992,7 +5000,7 @@ describe('File', () => {
4992
5000
4993
5001
// eslint-disable-next-line @typescript-eslint/no-explicit-any
4994
5002
makeWritableStreamOverride = ( stream : { } , options_ : any ) => {
4995
- assert . strictEqual ( options_ . metadata , options . metadata ) ;
5003
+ assert . deepStrictEqual ( options_ . metadata , options . metadata ) ;
4996
5004
assert . deepStrictEqual ( options_ . request , {
4997
5005
qs : {
4998
5006
name : file . name ,
0 commit comments