Files
lustpress/test/lustpress.test.ts
Indrawan I. cd32689b47 feat(core): hard remake with bun and elysia (#19)
* static files changes

* remake modifiers

* test case

* some docs changes

* deps and rule changes

* edit proper interfaces

* remake getServer

* @elysiajs/swagger

* remake tsconfig

* ci changes use bun

* docs changes

* feat(core): hard remake with bun and elysia

* chore(release): 8.2.0-alpha

* auto release

* ci

* update global

* chore(release): 8.2.1-alpha

* ci
2026-05-14 04:57:54 +07:00

57 lines
1.1 KiB
TypeScript

import { test } from "bun:test";
import assert from "node:assert/strict";
const port = process.env.PORT ?? 3000;
type ApiResponse = {
success: boolean;
data?: {
id?: string | number;
};
};
async function run(path: string) {
const res = await fetch(`http://localhost:${port}${path}`);
assert.equal(res.status, 200);
const json = (await res.json()) as ApiResponse;
console.log(JSON.stringify(json, null, 2));
if (!json.success) {
throw new Error("scraper failed");
}
}
test("pornhub", async () => {
await run("/pornhub/random");
}, 300000);
test("xnxx", async () => {
await run("/xnxx/random");
}, 120000);
test("redtube", async () => {
await run("/redtube/random");
}, 120000);
test("xvideos", async () => {
await run("/xvideos/random");
}, 120000);
test("xhamster", async () => {
await run("/xhamster/random");
}, 120000);
test("youporn", async () => {
await run("/youporn/random");
}, 120000);
test("eporner", async () => {
await run("/eporner/random");
}, 120000);
test("txxx", async () => {
await run("/txxx/random");
}, 120000);