@@ -26,22 +26,22 @@ describe('instantiate client', () => {
2626 bearerToken : 'My Bearer Token' ,
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 } ,
@@ -354,7 +354,7 @@ describe('instantiate client', () => {
354354 } ) ;
355355
356356 describe ( 'withOptions' , ( ) => {
357- test ( 'creates a new client with overridden options' , ( ) => {
357+ test ( 'creates a new client with overridden options' , async ( ) => {
358358 const client = new Gitpod ( {
359359 baseURL : 'http://localhost:5000/' ,
360360 maxRetries : 3 ,
@@ -379,7 +379,7 @@ describe('instantiate client', () => {
379379 expect ( newClient . constructor ) . toBe ( client . constructor ) ;
380380 } ) ;
381381
382- test ( 'inherits options from the parent client' , ( ) => {
382+ test ( 'inherits options from the parent client' , async ( ) => {
383383 const client = new Gitpod ( {
384384 baseURL : 'http://localhost:5000/' ,
385385 defaultHeaders : { 'X-Test-Header' : 'test-value' } ,
@@ -394,7 +394,7 @@ describe('instantiate client', () => {
394394 // Test inherited options remain the same
395395 expect ( newClient . buildURL ( '/foo' , null ) ) . toEqual ( 'http://localhost:5001/foo?test-param=test-value' ) ;
396396
397- const { req } = newClient . buildRequest ( { path : '/foo' , method : 'get' } ) ;
397+ const { req } = await newClient . buildRequest ( { path : '/foo' , method : 'get' } ) ;
398398 expect ( req . headers . get ( 'x-test-header' ) ) . toEqual ( 'test-value' ) ;
399399 } ) ;
400400
@@ -448,8 +448,8 @@ describe('request building', () => {
448448 const client = new Gitpod ( { bearerToken : 'My Bearer Token' } ) ;
449449
450450 describe ( 'custom headers' , ( ) => {
451- test ( 'handles undefined' , ( ) => {
452- const { req } = client . buildRequest ( {
451+ test ( 'handles undefined' , async ( ) => {
452+ const { req } = await client . buildRequest ( {
453453 path : '/foo' ,
454454 method : 'post' ,
455455 body : { value : 'hello' } ,
@@ -484,8 +484,8 @@ describe('default encoder', () => {
484484 }
485485 }
486486 for ( const jsonValue of [ { } , [ ] , { __proto__ : null } , new Serializable ( ) , new Collection ( [ 'item' ] ) ] ) {
487- test ( `serializes ${ util . inspect ( jsonValue ) } as json` , ( ) => {
488- const { req } = client . buildRequest ( {
487+ test ( `serializes ${ util . inspect ( jsonValue ) } as json` , async ( ) => {
488+ const { req } = await client . buildRequest ( {
489489 path : '/foo' ,
490490 method : 'post' ,
491491 body : jsonValue ,
@@ -508,7 +508,7 @@ describe('default encoder', () => {
508508 asyncIterable ,
509509 ] ) {
510510 test ( `converts ${ util . inspect ( streamValue ) } to ReadableStream` , async ( ) => {
511- const { req } = client . buildRequest ( {
511+ const { req } = await client . buildRequest ( {
512512 path : '/foo' ,
513513 method : 'post' ,
514514 body : streamValue ,
@@ -521,7 +521,7 @@ describe('default encoder', () => {
521521 }
522522
523523 test ( `can set content-type for ReadableStream` , async ( ) => {
524- const { req } = client . buildRequest ( {
524+ const { req } = await client . buildRequest ( {
525525 path : '/foo' ,
526526 method : 'post' ,
527527 body : new Response ( 'a\nb\nc\n' ) . body ,
0 commit comments