@@ -15,18 +15,18 @@ describe('auth', () => {
15
15
bh
16
16
] )
17
17
const res : httpm . HttpClientResponse = await http . get (
18
- 'http://httpbin.org /get'
18
+ 'http://postman-echo.com /get'
19
19
)
20
20
expect ( res . message . statusCode ) . toBe ( 200 )
21
21
const body : string = await res . readBody ( )
22
22
const obj = JSON . parse ( body )
23
- const auth : string = obj . headers . Authorization
23
+ const auth : string = obj . headers . authorization
24
24
const creds : string = Buffer . from (
25
25
auth . substring ( 'Basic ' . length ) ,
26
26
'base64'
27
27
) . toString ( )
28
28
expect ( creds ) . toBe ( 'johndoe:password' )
29
- expect ( obj . url ) . toBe ( 'http://httpbin.org /get' )
29
+ expect ( obj . url ) . toBe ( 'http://postman-echo.com /get' )
30
30
} )
31
31
32
32
it ( 'does basic http get request with pat token auth' , async ( ) => {
@@ -39,18 +39,18 @@ describe('auth', () => {
39
39
ph
40
40
] )
41
41
const res : httpm . HttpClientResponse = await http . get (
42
- 'http://httpbin.org /get'
42
+ 'http://postman-echo.com /get'
43
43
)
44
44
expect ( res . message . statusCode ) . toBe ( 200 )
45
45
const body : string = await res . readBody ( )
46
46
const obj = JSON . parse ( body )
47
- const auth : string = obj . headers . Authorization
47
+ const auth : string = obj . headers . authorization
48
48
const creds : string = Buffer . from (
49
49
auth . substring ( 'Basic ' . length ) ,
50
50
'base64'
51
51
) . toString ( )
52
52
expect ( creds ) . toBe ( `PAT:${ token } ` )
53
- expect ( obj . url ) . toBe ( 'http://httpbin.org /get' )
53
+ expect ( obj . url ) . toBe ( 'http://postman-echo.com /get' )
54
54
} )
55
55
56
56
it ( 'does basic http get request with pat token auth' , async ( ) => {
@@ -61,13 +61,13 @@ describe('auth', () => {
61
61
ph
62
62
] )
63
63
const res : httpm . HttpClientResponse = await http . get (
64
- 'http://httpbin.org /get'
64
+ 'http://postman-echo.com /get'
65
65
)
66
66
expect ( res . message . statusCode ) . toBe ( 200 )
67
67
const body : string = await res . readBody ( )
68
68
const obj = JSON . parse ( body )
69
- const auth : string = obj . headers . Authorization
69
+ const auth : string = obj . headers . authorization
70
70
expect ( auth ) . toBe ( `Bearer ${ token } ` )
71
- expect ( obj . url ) . toBe ( 'http://httpbin.org /get' )
71
+ expect ( obj . url ) . toBe ( 'http://postman-echo.com /get' )
72
72
} )
73
73
} )
0 commit comments