-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
779 changed files
with
589,542 additions
and
1,024,782 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
dist/ | ||
dist | ||
node_nodules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,28 @@ | ||
{ | ||
"env": { | ||
"commonjs": true, | ||
"es6": true, | ||
"es2021": true, | ||
"jest": true, | ||
"node": true | ||
}, | ||
"extends": "eslint:recommended", | ||
"globals": { | ||
"Atomics": "readonly", | ||
"SharedArrayBuffer": "readonly" | ||
}, | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": 2018 | ||
"ecmaVersion": 2021, | ||
"sourceType": "module" | ||
}, | ||
"plugins": [ | ||
"@typescript-eslint" | ||
], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended" | ||
], | ||
"rules": { | ||
"@typescript-eslint/no-explicit-any": "off" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
}) |
Oops, something went wrong.