Files
bun.sh/test/regression/issue/02367.test.ts
2023-03-13 17:13:24 -07:00

7 lines
275 B
TypeScript

import { test, expect } 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);
});