@@ -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 as Headers ) [ '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 as Headers ) [ '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 } ,
@@ -237,20 +237,20 @@ describe('request building', () => {
237237 const client = new ZeroEntropy ( { apiKey : 'My API Key' } ) ;
238238
239239 describe ( 'Content-Length' , ( ) => {
240- test ( 'handles multi-byte characters' , ( ) => {
241- const { req } = client . buildRequest ( { path : '/foo' , method : 'post' , body : { value : '—' } } ) ;
240+ test ( 'handles multi-byte characters' , async ( ) => {
241+ const { req } = await client . buildRequest ( { path : '/foo' , method : 'post' , body : { value : '—' } } ) ;
242242 expect ( ( req . headers as Record < string , string > ) [ 'content-length' ] ) . toEqual ( '20' ) ;
243243 } ) ;
244244
245- test ( 'handles standard characters' , ( ) => {
246- const { req } = client . buildRequest ( { path : '/foo' , method : 'post' , body : { value : 'hello' } } ) ;
245+ test ( 'handles standard characters' , async ( ) => {
246+ const { req } = await client . buildRequest ( { path : '/foo' , method : 'post' , body : { value : 'hello' } } ) ;
247247 expect ( ( req . headers as Record < string , string > ) [ 'content-length' ] ) . toEqual ( '22' ) ;
248248 } ) ;
249249 } ) ;
250250
251251 describe ( 'custom headers' , ( ) => {
252- test ( 'handles undefined' , ( ) => {
253- const { req } = client . buildRequest ( {
252+ test ( 'handles undefined' , async ( ) => {
253+ const { req } = await client . buildRequest ( {
254254 path : '/foo' ,
255255 method : 'post' ,
256256 body : { value : 'hello' } ,
0 commit comments