diff options
author | 2022-03-18 20:18:58 -0700 | |
---|---|---|
committer | 2022-03-18 20:18:58 -0700 | |
commit | 7dc76bf70902de10cb4f4752dae4c7e90cfc1027 (patch) | |
tree | 3cf1d033aec0f800f0093834d05fb8b485f0333d /integration/bunjs-only-snippets/fetch.test.js | |
parent | 20ec3d9bbda91495b84ea8caaa71178c40340f35 (diff) | |
download | bun-7dc76bf70902de10cb4f4752dae4c7e90cfc1027.tar.gz bun-7dc76bf70902de10cb4f4752dae4c7e90cfc1027.tar.zst bun-7dc76bf70902de10cb4f4752dae4c7e90cfc1027.zip |
Set charset=utf-8 for better consistentcy
Diffstat (limited to 'integration/bunjs-only-snippets/fetch.test.js')
-rw-r--r-- | integration/bunjs-only-snippets/fetch.test.js | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/integration/bunjs-only-snippets/fetch.test.js b/integration/bunjs-only-snippets/fetch.test.js index 87cd5414f..b1ab57366 100644 --- a/integration/bunjs-only-snippets/fetch.test.js +++ b/integration/bunjs-only-snippets/fetch.test.js @@ -280,13 +280,17 @@ describe("Response", () => { it("sets the content-type header", () => { let response = Response.json("hello"); expect(response.type).toBe("basic"); - expect(response.headers.get("content-type")).toBe("application/json"); + expect(response.headers.get("content-type")).toBe( + "application/json;charset=utf-8" + ); expect(response.status).toBe(200); }); it("supports number status code", () => { let response = Response.json("hello", 407); expect(response.type).toBe("basic"); - expect(response.headers.get("content-type")).toBe("application/json"); + expect(response.headers.get("content-type")).toBe( + "application/json;charset=utf-8" + ); expect(response.status).toBe(407); }); it("overrides the content-type header", () => { @@ -296,7 +300,9 @@ describe("Response", () => { }, }); expect(response.type).toBe("basic"); - expect(response.headers.get("content-type")).toBe("application/json"); + expect(response.headers.get("content-type")).toBe( + "application/json;charset=utf-8" + ); }); it("supports headers", () => { var response = Response.json("hello", { @@ -306,7 +312,9 @@ describe("Response", () => { }, statusCode: 408, }); - expect(response.headers.get("content-type")).toBe("application/json"); + expect(response.headers.get("content-type")).toBe( + "application/json;charset=utf-8" + ); expect(response.headers.get("x-hello")).toBe("world"); expect(response.status).toBe(408); }); |