mirror of
https://github.com/actions/toolkit
synced 2025-05-08 16:17:40 +00:00
Use postman-echo to replace httpbin
This commit is contained in:
parent
457303960f
commit
672c88ec4b
5 changed files with 126 additions and 121 deletions
|
@ -13,24 +13,24 @@ describe('basics', () => {
|
|||
|
||||
it('does basic http get request with keepAlive true', async () => {
|
||||
const res: httpm.HttpClientResponse = await _http.get(
|
||||
'http://httpbin.org/get'
|
||||
'http://postman-echo.com/get'
|
||||
)
|
||||
expect(res.message.statusCode).toBe(200)
|
||||
const body: string = await res.readBody()
|
||||
const obj = JSON.parse(body)
|
||||
expect(obj.url).toBe('http://httpbin.org/get')
|
||||
expect(obj.url).toBe('http://postman-echo.com/get')
|
||||
})
|
||||
|
||||
it('does basic head request with keepAlive true', async () => {
|
||||
const res: httpm.HttpClientResponse = await _http.head(
|
||||
'http://httpbin.org/get'
|
||||
'http://postman-echo.com/get'
|
||||
)
|
||||
expect(res.message.statusCode).toBe(200)
|
||||
})
|
||||
|
||||
it('does basic http delete request with keepAlive true', async () => {
|
||||
const res: httpm.HttpClientResponse = await _http.del(
|
||||
'http://httpbin.org/delete'
|
||||
'http://postman-echo.com/delete'
|
||||
)
|
||||
expect(res.message.statusCode).toBe(200)
|
||||
const body: string = await res.readBody()
|
||||
|
@ -40,32 +40,32 @@ describe('basics', () => {
|
|||
it('does basic http post request with keepAlive true', async () => {
|
||||
const b = 'Hello World!'
|
||||
const res: httpm.HttpClientResponse = await _http.post(
|
||||
'http://httpbin.org/post',
|
||||
'http://postman-echo.com/post',
|
||||
b
|
||||
)
|
||||
expect(res.message.statusCode).toBe(200)
|
||||
const body: string = await res.readBody()
|
||||
const obj = JSON.parse(body)
|
||||
expect(obj.data).toBe(b)
|
||||
expect(obj.url).toBe('http://httpbin.org/post')
|
||||
expect(obj.url).toBe('http://postman-echo.com/post')
|
||||
})
|
||||
|
||||
it('does basic http patch request with keepAlive true', async () => {
|
||||
const b = 'Hello World!'
|
||||
const res: httpm.HttpClientResponse = await _http.patch(
|
||||
'http://httpbin.org/patch',
|
||||
'http://postman-echo.com/patch',
|
||||
b
|
||||
)
|
||||
expect(res.message.statusCode).toBe(200)
|
||||
const body: string = await res.readBody()
|
||||
const obj = JSON.parse(body)
|
||||
expect(obj.data).toBe(b)
|
||||
expect(obj.url).toBe('http://httpbin.org/patch')
|
||||
expect(obj.url).toBe('http://postman-echo.com/patch')
|
||||
})
|
||||
|
||||
it('does basic http options request with keepAlive true', async () => {
|
||||
const res: httpm.HttpClientResponse = await _http.options(
|
||||
'http://httpbin.org'
|
||||
'http://postman-echo.com'
|
||||
)
|
||||
expect(res.message.statusCode).toBe(200)
|
||||
await res.readBody()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue