Skip to content

Commit 672c88e

Browse files
committed
Use postman-echo to replace httpbin
1 parent 4573039 commit 672c88e

File tree

5 files changed

+126
-121
lines changed

5 files changed

+126
-121
lines changed

packages/http-client/__tests__/auth.test.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ describe('auth', () => {
1515
bh
1616
])
1717
const res: httpm.HttpClientResponse = await http.get(
18-
'http://httpbin.org/get'
18+
'http://postman-echo.com/get'
1919
)
2020
expect(res.message.statusCode).toBe(200)
2121
const body: string = await res.readBody()
2222
const obj = JSON.parse(body)
23-
const auth: string = obj.headers.Authorization
23+
const auth: string = obj.headers.authorization
2424
const creds: string = Buffer.from(
2525
auth.substring('Basic '.length),
2626
'base64'
2727
).toString()
2828
expect(creds).toBe('johndoe:password')
29-
expect(obj.url).toBe('http://httpbin.org/get')
29+
expect(obj.url).toBe('http://postman-echo.com/get')
3030
})
3131

3232
it('does basic http get request with pat token auth', async () => {
@@ -39,18 +39,18 @@ describe('auth', () => {
3939
ph
4040
])
4141
const res: httpm.HttpClientResponse = await http.get(
42-
'http://httpbin.org/get'
42+
'http://postman-echo.com/get'
4343
)
4444
expect(res.message.statusCode).toBe(200)
4545
const body: string = await res.readBody()
4646
const obj = JSON.parse(body)
47-
const auth: string = obj.headers.Authorization
47+
const auth: string = obj.headers.authorization
4848
const creds: string = Buffer.from(
4949
auth.substring('Basic '.length),
5050
'base64'
5151
).toString()
5252
expect(creds).toBe(`PAT:${token}`)
53-
expect(obj.url).toBe('http://httpbin.org/get')
53+
expect(obj.url).toBe('http://postman-echo.com/get')
5454
})
5555

5656
it('does basic http get request with pat token auth', async () => {
@@ -61,13 +61,13 @@ describe('auth', () => {
6161
ph
6262
])
6363
const res: httpm.HttpClientResponse = await http.get(
64-
'http://httpbin.org/get'
64+
'http://postman-echo.com/get'
6565
)
6666
expect(res.message.statusCode).toBe(200)
6767
const body: string = await res.readBody()
6868
const obj = JSON.parse(body)
69-
const auth: string = obj.headers.Authorization
69+
const auth: string = obj.headers.authorization
7070
expect(auth).toBe(`Bearer ${token}`)
71-
expect(obj.url).toBe('http://httpbin.org/get')
71+
expect(obj.url).toBe('http://postman-echo.com/get')
7272
})
7373
})

0 commit comments

Comments
 (0)