import { describe, expect, test } from "bun:test"; test("zero args returns an otherwise empty 200 response", () => { const response = new Response(); expect(response.status).toBe(200); expect(response.statusText).toBe(""); }); test("calling cancel() on response body doesn't throw", () => { expect(() => new Response("").body?.cancel()).not.toThrow(); }); test("undefined args don't throw", () => { const response = new Response("", { status: undefined, statusText: undefined, headers: undefined, }); expect(response.status).toBe(200); expect(response.statusText).toBe(""); }); test("1-arg form returns a 200 response", () => { const response = new Response("body text"); expect(response.status).toBe(200); expect(response.statusText).toBe(""); }); describe("2-arg form", () => { test("can fill in status/statusText, and it works", () => { const response = new Response("body text", { status: 202, statusText: "Accepted.", }); expect(response.status).toBe(202); expect(response.statusText).toBe("Accepted."); }); test('empty object continues to return 200/""', () => { const response = new Response("body text", {}); expect(response.status).toBe(200); expect(response.statusText).toBe(""); }); });