Files
bun.sh/test/js/bun/test/parallel/test-http-4415-Server-es5.ts
2025-09-30 17:25:17 -07:00

13 lines
377 B
TypeScript

import { createTest } from "node-harness";
import { once } from "node:events";
import { Server } from "node:http";
const { expect } = createTest(import.meta.path);
await using server = Server((req, res) => {
res.end();
});
server.listen(0);
await once(server, "listening");
const res = await fetch(`http://localhost:${server.address().port}`);
expect(res.status).toBe(200);