@@ -280,15 +280,9 @@ describe('set', () => {
280
280
expect ( options ?. method ) . toBe ( 'put' )
281
281
282
282
if ( url === `https://api.netlify.com/api/v1/sites/${ siteID } /blobs/${ key } ?context=production` ) {
283
- const data = JSON . stringify ( { url : signedURL } )
284
-
285
283
expect ( headers . authorization ) . toBe ( `Bearer ${ apiToken } ` )
286
284
287
- return new Response ( data )
288
- }
289
-
290
- if ( url === signedURL ) {
291
- return new Response ( 'Something went wrong' , { status : 401 } )
285
+ return new Response ( null , { status : 401 } )
292
286
}
293
287
294
288
throw new Error ( `Unexpected fetch call: ${ url } ` )
@@ -303,7 +297,7 @@ describe('set', () => {
303
297
} )
304
298
305
299
expect ( async ( ) => await blobs . set ( key , 'value' ) ) . rejects . toThrowError (
306
- 'put operation has failed: Something went wrong ' ,
300
+ 'put operation has failed: API returned a 401 response ' ,
307
301
)
308
302
} )
309
303
} )
@@ -354,11 +348,9 @@ describe('delete', () => {
354
348
expect ( options ?. method ) . toBe ( 'delete' )
355
349
356
350
if ( url === `https://api.netlify.com/api/v1/sites/${ siteID } /blobs/${ key } ?context=production` ) {
357
- const data = JSON . stringify ( { url : signedURL } )
358
-
359
351
expect ( headers . authorization ) . toBe ( `Bearer ${ apiToken } ` )
360
352
361
- return new Response ( data )
353
+ return new Response ( null , { status : 401 } )
362
354
}
363
355
364
356
if ( url === signedURL ) {
@@ -377,7 +369,7 @@ describe('delete', () => {
377
369
} )
378
370
379
371
expect ( async ( ) => await blobs . delete ( key ) ) . rejects . toThrowError (
380
- 'delete operation has failed: Something went wrong ' ,
372
+ 'delete operation has failed: API returned a 401 response ' ,
381
373
)
382
374
} )
383
375
} )
0 commit comments