@@ -27,22 +27,22 @@ describe('instantiate client', () => {
27
27
28
28
} ) ;
29
29
30
- test ( 'they are used in the request' , ( ) => {
31
- const { req } = client . buildRequest ( { path : '/foo' , method : 'post' } ) ;
30
+ test ( 'they are used in the request' , async ( ) => {
31
+ const { req } = await client . buildRequest ( { path : '/foo' , method : 'post' } ) ;
32
32
expect ( ( req . headers as Headers ) [ 'x-my-default-header' ] ) . toEqual ( '2' ) ;
33
33
} ) ;
34
34
35
- test ( 'can ignore `undefined` and leave the default' , ( ) => {
36
- const { req } = client . buildRequest ( {
35
+ test ( 'can ignore `undefined` and leave the default' , async ( ) => {
36
+ const { req } = await client . buildRequest ( {
37
37
path : '/foo' ,
38
38
method : 'post' ,
39
39
headers : { 'X-My-Default-Header' : undefined } ,
40
40
} ) ;
41
41
expect ( ( req . headers as Headers ) [ 'x-my-default-header' ] ) . toEqual ( '2' ) ;
42
42
} ) ;
43
43
44
- test ( 'can be removed with `null`' , ( ) => {
45
- const { req } = client . buildRequest ( {
44
+ test ( 'can be removed with `null`' , async ( ) => {
45
+ const { req } = await client . buildRequest ( {
46
46
path : '/foo' ,
47
47
method : 'post' ,
48
48
headers : { 'X-My-Default-Header' : null } ,
@@ -290,20 +290,20 @@ describe('request building', () => {
290
290
const client = new Cloudflare ( { apiKey :
'144c9defac04969c7bfad8efaa8ea194' , apiEmail :
'[email protected] ' } ) ;
291
291
292
292
describe ( 'Content-Length' , ( ) => {
293
- test ( 'handles multi-byte characters' , ( ) => {
294
- const { req } = client . buildRequest ( { path : '/foo' , method : 'post' , body : { value : '—' } } ) ;
293
+ test ( 'handles multi-byte characters' , async ( ) => {
294
+ const { req } = await client . buildRequest ( { path : '/foo' , method : 'post' , body : { value : '—' } } ) ;
295
295
expect ( ( req . headers as Record < string , string > ) [ 'content-length' ] ) . toEqual ( '20' ) ;
296
296
} ) ;
297
297
298
- test ( 'handles standard characters' , ( ) => {
299
- const { req } = client . buildRequest ( { path : '/foo' , method : 'post' , body : { value : 'hello' } } ) ;
298
+ test ( 'handles standard characters' , async ( ) => {
299
+ const { req } = await client . buildRequest ( { path : '/foo' , method : 'post' , body : { value : 'hello' } } ) ;
300
300
expect ( ( req . headers as Record < string , string > ) [ 'content-length' ] ) . toEqual ( '22' ) ;
301
301
} ) ;
302
302
} ) ;
303
303
304
304
describe ( 'custom headers' , ( ) => {
305
- test ( 'handles undefined' , ( ) => {
306
- const { req } = client . buildRequest ( {
305
+ test ( 'handles undefined' , async ( ) => {
306
+ const { req } = await client . buildRequest ( {
307
307
path : '/foo' ,
308
308
method : 'post' ,
309
309
body : { value : 'hello' } ,
0 commit comments