@@ -25,22 +25,22 @@ describe('instantiate client', () => {
25
25
apiKey : 'My API Key' ,
26
26
} ) ;
27
27
28
- test ( 'they are used in the request' , ( ) => {
29
- const { req } = client . buildRequest ( { path : '/foo' , method : 'post' } ) ;
28
+ test ( 'they are used in the request' , async ( ) => {
29
+ const { req } = await client . buildRequest ( { path : '/foo' , method : 'post' } ) ;
30
30
expect ( ( req . headers as Headers ) [ 'x-my-default-header' ] ) . toEqual ( '2' ) ;
31
31
} ) ;
32
32
33
- test ( 'can ignore `undefined` and leave the default' , ( ) => {
34
- const { req } = client . buildRequest ( {
33
+ test ( 'can ignore `undefined` and leave the default' , async ( ) => {
34
+ const { req } = await client . buildRequest ( {
35
35
path : '/foo' ,
36
36
method : 'post' ,
37
37
headers : { 'X-My-Default-Header' : undefined } ,
38
38
} ) ;
39
39
expect ( ( req . headers as Headers ) [ 'x-my-default-header' ] ) . toEqual ( '2' ) ;
40
40
} ) ;
41
41
42
- test ( 'can be removed with `null`' , ( ) => {
43
- const { req } = client . buildRequest ( {
42
+ test ( 'can be removed with `null`' , async ( ) => {
43
+ const { req } = await client . buildRequest ( {
44
44
path : '/foo' ,
45
45
method : 'post' ,
46
46
headers : { 'X-My-Default-Header' : null } ,
@@ -255,20 +255,20 @@ describe('request building', () => {
255
255
const client = new OnebusawaySDK ( { apiKey : 'My API Key' } ) ;
256
256
257
257
describe ( 'Content-Length' , ( ) => {
258
- test ( 'handles multi-byte characters' , ( ) => {
259
- const { req } = client . buildRequest ( { path : '/foo' , method : 'post' , body : { value : '—' } } ) ;
258
+ test ( 'handles multi-byte characters' , async ( ) => {
259
+ const { req } = await client . buildRequest ( { path : '/foo' , method : 'post' , body : { value : '—' } } ) ;
260
260
expect ( ( req . headers as Record < string , string > ) [ 'content-length' ] ) . toEqual ( '20' ) ;
261
261
} ) ;
262
262
263
- test ( 'handles standard characters' , ( ) => {
264
- const { req } = client . buildRequest ( { path : '/foo' , method : 'post' , body : { value : 'hello' } } ) ;
263
+ test ( 'handles standard characters' , async ( ) => {
264
+ const { req } = await client . buildRequest ( { path : '/foo' , method : 'post' , body : { value : 'hello' } } ) ;
265
265
expect ( ( req . headers as Record < string , string > ) [ 'content-length' ] ) . toEqual ( '22' ) ;
266
266
} ) ;
267
267
} ) ;
268
268
269
269
describe ( 'custom headers' , ( ) => {
270
- test ( 'handles undefined' , ( ) => {
271
- const { req } = client . buildRequest ( {
270
+ test ( 'handles undefined' , async ( ) => {
271
+ const { req } = await client . buildRequest ( {
272
272
path : '/foo' ,
273
273
method : 'post' ,
274
274
body : { value : 'hello' } ,
0 commit comments