@@ -26,22 +26,22 @@ describe('instantiate client', () => {
2626 apiKey : 'My API Key' ,
2727 } ) ;
2828
29- test ( 'they are used in the request' , ( ) => {
30- const { req } = client . buildRequest ( { path : '/foo' , method : 'post' } ) ;
29+ test ( 'they are used in the request' , async ( ) => {
30+ const { req } = await client . buildRequest ( { path : '/foo' , method : 'post' } ) ;
3131 expect ( req . headers . get ( 'x-my-default-header' ) ) . toEqual ( '2' ) ;
3232 } ) ;
3333
34- test ( 'can ignore `undefined` and leave the default' , ( ) => {
35- const { req } = client . buildRequest ( {
34+ test ( 'can ignore `undefined` and leave the default' , async ( ) => {
35+ const { req } = await client . buildRequest ( {
3636 path : '/foo' ,
3737 method : 'post' ,
3838 headers : { 'X-My-Default-Header' : undefined } ,
3939 } ) ;
4040 expect ( req . headers . get ( 'x-my-default-header' ) ) . toEqual ( '2' ) ;
4141 } ) ;
4242
43- test ( 'can be removed with `null`' , ( ) => {
44- const { req } = client . buildRequest ( {
43+ test ( 'can be removed with `null`' , async ( ) => {
44+ const { req } = await client . buildRequest ( {
4545 path : '/foo' ,
4646 method : 'post' ,
4747 headers : { 'X-My-Default-Header' : null } ,
@@ -340,7 +340,7 @@ describe('instantiate client', () => {
340340 } ) ;
341341
342342 describe ( 'withOptions' , ( ) => {
343- test ( 'creates a new client with overridden options' , ( ) => {
343+ test ( 'creates a new client with overridden options' , async ( ) => {
344344 const client = new Grid ( { baseURL : 'http://localhost:5000/' , maxRetries : 3 , apiKey : 'My API Key' } ) ;
345345
346346 const newClient = client . withOptions ( {
@@ -361,7 +361,7 @@ describe('instantiate client', () => {
361361 expect ( newClient . constructor ) . toBe ( client . constructor ) ;
362362 } ) ;
363363
364- test ( 'inherits options from the parent client' , ( ) => {
364+ test ( 'inherits options from the parent client' , async ( ) => {
365365 const client = new Grid ( {
366366 baseURL : 'http://localhost:5000/' ,
367367 defaultHeaders : { 'X-Test-Header' : 'test-value' } ,
@@ -376,7 +376,7 @@ describe('instantiate client', () => {
376376 // Test inherited options remain the same
377377 expect ( newClient . buildURL ( '/foo' , null ) ) . toEqual ( 'http://localhost:5001/foo?test-param=test-value' ) ;
378378
379- const { req } = newClient . buildRequest ( { path : '/foo' , method : 'get' } ) ;
379+ const { req } = await newClient . buildRequest ( { path : '/foo' , method : 'get' } ) ;
380380 expect ( req . headers . get ( 'x-test-header' ) ) . toEqual ( 'test-value' ) ;
381381 } ) ;
382382
@@ -426,8 +426,8 @@ describe('request building', () => {
426426 const client = new Grid ( { apiKey : 'My API Key' } ) ;
427427
428428 describe ( 'custom headers' , ( ) => {
429- test ( 'handles undefined' , ( ) => {
430- const { req } = client . buildRequest ( {
429+ test ( 'handles undefined' , async ( ) => {
430+ const { req } = await client . buildRequest ( {
431431 path : '/foo' ,
432432 method : 'post' ,
433433 body : { value : 'hello' } ,
@@ -462,8 +462,8 @@ describe('default encoder', () => {
462462 }
463463 }
464464 for ( const jsonValue of [ { } , [ ] , { __proto__ : null } , new Serializable ( ) , new Collection ( [ 'item' ] ) ] ) {
465- test ( `serializes ${ util . inspect ( jsonValue ) } as json` , ( ) => {
466- const { req } = client . buildRequest ( {
465+ test ( `serializes ${ util . inspect ( jsonValue ) } as json` , async ( ) => {
466+ const { req } = await client . buildRequest ( {
467467 path : '/foo' ,
468468 method : 'post' ,
469469 body : jsonValue ,
@@ -486,7 +486,7 @@ describe('default encoder', () => {
486486 asyncIterable ,
487487 ] ) {
488488 test ( `converts ${ util . inspect ( streamValue ) } to ReadableStream` , async ( ) => {
489- const { req } = client . buildRequest ( {
489+ const { req } = await client . buildRequest ( {
490490 path : '/foo' ,
491491 method : 'post' ,
492492 body : streamValue ,
@@ -499,7 +499,7 @@ describe('default encoder', () => {
499499 }
500500
501501 test ( `can set content-type for ReadableStream` , async ( ) => {
502- const { req } = client . buildRequest ( {
502+ const { req } = await client . buildRequest ( {
503503 path : '/foo' ,
504504 method : 'post' ,
505505 body : new Response ( 'a\nb\nc\n' ) . body ,
0 commit comments