@@ -57,43 +57,12 @@ describe('get', () => {
57
57
fetcher,
58
58
siteID,
59
59
} )
60
- const val = await blobs . get ( key )
61
60
62
- expect ( val ) . toBe ( value )
63
- } )
64
-
65
- test ( 'Returns a stream' , async ( ) => {
66
- const fetcher = async ( ...args : Parameters < typeof globalThis . fetch > ) => {
67
- const [ url , options ] = args
68
- const headers = options ?. headers as Record < string , string >
69
-
70
- expect ( options ?. method ) . toBe ( 'get' )
71
-
72
- if ( url === `https://api.netlify.com/api/v1/sites/${ siteID } /blobs/${ key } ?context=production` ) {
73
- const data = JSON . stringify ( { url : signedURL } )
74
-
75
- expect ( headers . authorization ) . toBe ( `Bearer ${ apiToken } ` )
76
-
77
- return new Response ( data )
78
- }
79
-
80
- if ( url === signedURL ) {
81
- return new Response ( value )
82
- }
83
-
84
- throw new Error ( `Unexpected fetch call: ${ url } ` )
85
- }
86
-
87
- const blobs = new Blobs ( {
88
- authentication : {
89
- token : apiToken ,
90
- } ,
91
- fetcher,
92
- siteID,
93
- } )
94
- const val = await blobs . get ( key , { type : 'stream' } )
61
+ const string = await blobs . get ( key )
62
+ expect ( string ) . toBe ( value )
95
63
96
- expect ( await streamToString ( val as unknown as NodeJS . ReadableStream ) ) . toBe ( value )
64
+ const stream = await blobs . get ( key , { type : 'stream' } )
65
+ expect ( await streamToString ( stream as unknown as NodeJS . ReadableStream ) ) . toBe ( value )
97
66
} )
98
67
99
68
test ( 'Returns `null` when the pre-signed URL returns a 404' , async ( ) => {
0 commit comments