mirror of
https://github.com/joelwmale/webhook-action.git
synced 2026-08-31 00:19:45 +08:00
chore: updating deps
This commit is contained in:
+19
-19
@@ -1,31 +1,31 @@
|
||||
import { http } from '../src/http'
|
||||
import {http} from '../src/http'
|
||||
import {expect, test} from '@jest/globals'
|
||||
|
||||
test('it makes a post request', async () => {
|
||||
const url = 'https://httpbin.org/post'
|
||||
const body = '{"hello": "world"}'
|
||||
const res = await http.make(url, body)
|
||||
expect(res.status).toBe(200)
|
||||
const url = 'https://httpbin.org/post'
|
||||
const body = '{"hello": "world"}'
|
||||
const res = await http.make(url, body)
|
||||
expect(res.status).toBe(200)
|
||||
})
|
||||
|
||||
test('it makes a post request with insecure', async () => {
|
||||
const url = 'https://httpbin.org/post'
|
||||
const body = '{"hello": "world"}'
|
||||
const insecure = true
|
||||
const res = await http.make(url, body, null, insecure)
|
||||
expect(res.status).toBe(200)
|
||||
const url = 'https://httpbin.org/post'
|
||||
const body = '{"hello": "world"}'
|
||||
const insecure = true
|
||||
const res = await http.make(url, body, null, insecure)
|
||||
expect(res.status).toBe(200)
|
||||
})
|
||||
|
||||
test('it makes a post request with headers', async () => {
|
||||
const url = 'https://httpbin.org/post'
|
||||
const body = '{"hello": "world"}'
|
||||
const headers = '{"Content-Type": "application/json"}'
|
||||
const res = await http.make(url, body, headers)
|
||||
expect(res.status).toBe(200)
|
||||
const url = 'https://httpbin.org/post'
|
||||
const body = '{"hello": "world"}'
|
||||
const headers = '{"Content-Type": "application/json"}'
|
||||
const res = await http.make(url, body, headers)
|
||||
expect(res.status).toBe(200)
|
||||
})
|
||||
|
||||
test('it doesnt require a body', async () => {
|
||||
const url = 'https://httpbin.org/post'
|
||||
const res = await http.make(url, null)
|
||||
expect(res.status).toBe(200)
|
||||
})
|
||||
const url = 'https://httpbin.org/post'
|
||||
const res = await http.make(url, null)
|
||||
expect(res.status).toBe(200)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user