Files
bun.sh/test/regression/issue/02367.test.ts
2024-09-03 21:32:52 -07:00

7 lines
275 B
TypeScript

import { expect, test } from "bun:test";
test("should not be able to parse json from empty body", () => {
expect(async () => await new Response().json()).toThrow(SyntaxError);
expect(async () => await new Request("http://example.com/").json()).toThrow(SyntaxError);
});