@@ -26,22 +26,22 @@ describe('instantiate client', () => {
26
26
apiKey : 'My API Key' ,
27
27
} ) ;
28
28
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' } ) ;
31
31
expect ( ( req . headers as Headers ) [ 'x-my-default-header' ] ) . toEqual ( '2' ) ;
32
32
} ) ;
33
33
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 ( {
36
36
path : '/foo' ,
37
37
method : 'post' ,
38
38
headers : { 'X-My-Default-Header' : undefined } ,
39
39
} ) ;
40
40
expect ( ( req . headers as Headers ) [ 'x-my-default-header' ] ) . toEqual ( '2' ) ;
41
41
} ) ;
42
42
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 ( {
45
45
path : '/foo' ,
46
46
method : 'post' ,
47
47
headers : { 'X-My-Default-Header' : null } ,
@@ -237,20 +237,20 @@ describe('request building', () => {
237
237
const client = new Browserbase ( { apiKey : 'My API Key' } ) ;
238
238
239
239
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 : '—' } } ) ;
242
242
expect ( ( req . headers as Record < string , string > ) [ 'content-length' ] ) . toEqual ( '20' ) ;
243
243
} ) ;
244
244
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' } } ) ;
247
247
expect ( ( req . headers as Record < string , string > ) [ 'content-length' ] ) . toEqual ( '22' ) ;
248
248
} ) ;
249
249
} ) ;
250
250
251
251
describe ( 'custom headers' , ( ) => {
252
- test ( 'handles undefined' , ( ) => {
253
- const { req } = client . buildRequest ( {
252
+ test ( 'handles undefined' , async ( ) => {
253
+ const { req } = await client . buildRequest ( {
254
254
path : '/foo' ,
255
255
method : 'post' ,
256
256
body : { value : 'hello' } ,
0 commit comments