This repository has been archived on 2024-01-16. You can view files and clone it, but cannot push or open issues or pull requests.
Files
Maneger/tests/internal/httpRequest.ts

13 lines
931 B
TypeScript

import stream from "node:stream";
import { getExternalIP, getJSON, saveFile, pipeFetch, githubTree, GithubRelease } from "../../src/lib/httpRequest";
describe("HTTP Request", function(){
this.timeout(Infinity);
const Stream = new stream.Writable({write(chunk, encoding, callback) {callback()}});
it("External IP", async () => getExternalIP());
it("Github Releases", async () => GithubRelease("The-Bds-Maneger", "Bds-Maneger-Core"));
it("Github Tree", async () => githubTree("The-Bds-Maneger", "Bds-Maneger-Core"));
it("JSON", async () => getJSON("https://raw.githubusercontent.com/The-Bds-Maneger/Bds-Maneger-Core/main/package.json"));
it("Stream", async () => pipeFetch({stream: Stream, url: "https://raw.githubusercontent.com/The-Bds-Maneger/Bds-Maneger-Core/main/package.json"}));
it("Save File", async () => saveFile("https://raw.githubusercontent.com/The-Bds-Maneger/Bds-Maneger-Core/main/package.json"));
});