@@ -224,17 +224,17 @@ describe('basic tests (hello function)', () => {
224
224
* @feature fetch
225
225
*/
226
226
log ( 'create FunctionsClient' )
227
- const fclient = new FunctionsClient (
228
- `http://localhost: ${ relay . container . getMappedPort ( 8081 ) } ` , {
229
- customFetch : getCustomFetch (
230
- `http://localhost: ${ relay . container . getMappedPort ( 8081 ) } / ${ 'hello' } ` , {
227
+ const fclient = new FunctionsClient ( `http://localhost: ${ relay . container . getMappedPort ( 8081 ) } ` , {
228
+ customFetch : getCustomFetch (
229
+ `http://localhost: ${ relay . container . getMappedPort ( 8081 ) } / ${ 'hello' } ` ,
230
+ {
231
231
method : 'POST' ,
232
232
headers : {
233
233
Authorization : `Bearer ${ apiKey } ` ,
234
234
} ,
235
- } )
236
- }
237
- )
235
+ }
236
+ ) ,
237
+ } )
238
238
239
239
log ( 'invoke hello' )
240
240
const { data, error } = await fclient . invoke < string > ( '' , { responseType : 'text' } )
@@ -250,17 +250,17 @@ describe('basic tests (hello function)', () => {
250
250
* @feature fetch
251
251
*/
252
252
log ( 'create FunctionsClient' )
253
- const fclient = new FunctionsClient (
254
- `http://localhost: ${ relay . container . getMappedPort ( 8081 ) } ` , {
255
- customFetch : getCustomFetch (
256
- `http://localhost: ${ relay . container . getMappedPort ( 8081 ) } / ${ 'hello' } ` , {
253
+ const fclient = new FunctionsClient ( `http://localhost: ${ relay . container . getMappedPort ( 8081 ) } ` , {
254
+ customFetch : getCustomFetch (
255
+ `http://localhost: ${ relay . container . getMappedPort ( 8081 ) } / ${ 'hello' } ` ,
256
+ {
257
257
method : 'GET' ,
258
258
headers : {
259
259
Authorization : `Bearer ${ apiKey } ` ,
260
260
} ,
261
- } )
262
- }
263
- )
261
+ }
262
+ ) ,
263
+ } )
264
264
265
265
log ( 'invoke hello' )
266
266
const { data, error } = await fclient . invoke < string > ( '' , { responseType : 'text' } )
@@ -278,19 +278,20 @@ describe('basic tests (hello function)', () => {
278
278
*/
279
279
const wrongKey = sign ( { name : 'anon' } , 'wrong_jwt' )
280
280
log ( 'create FunctionsClient' )
281
- const fclient = new FunctionsClient (
282
- `http://localhost:${ relay . container . getMappedPort ( 8081 ) } ` , {
283
- headers : {
284
- Authorization : `Bearer ${ wrongKey } ` ,
285
- } ,
286
- customFetch : getCustomFetch ( `http://localhost:${ relay . container . getMappedPort ( 8081 ) } /${ 'hello' } ` , {
281
+ const fclient = new FunctionsClient ( `http://localhost:${ relay . container . getMappedPort ( 8081 ) } ` , {
282
+ headers : {
283
+ Authorization : `Bearer ${ wrongKey } ` ,
284
+ } ,
285
+ customFetch : getCustomFetch (
286
+ `http://localhost:${ relay . container . getMappedPort ( 8081 ) } /${ 'hello' } ` ,
287
+ {
287
288
method : 'Post' ,
288
289
headers : {
289
290
Authorization : `Bearer ${ apiKey } ` ,
290
291
} ,
291
- } )
292
- }
293
- )
292
+ }
293
+ ) ,
294
+ } )
294
295
295
296
log ( 'invoke hello with Authorization header' )
296
297
const { data, error } = await fclient . invoke < string > ( 'hello' , {
0 commit comments