Skip to content

Commit f3dc08c

Browse files
dmealingclaude
andcommitted
test(runtime-ts): pin literal META_CONTENT_TYPE value to catch constant typos
Add independent literal assertion in the Fastify test to detect changes to the constant's value itself. Hono test asserts against the constant only, proving the mount references it. Together: mounts agree, and the constant itself is correct. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015NrWUxA6euwvnFcwKxcK6A
1 parent 5e24b1a commit f3dc08c

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎server/typescript/packages/runtime-ts/test/meta-route.test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ describe("GET /_meta (fastify)", () => {
1616
const res = await app.inject({ method: "GET", url: "/api/_meta" });
1717

1818
expect(res.statusCode).toBe(200);
19+
// Pinned independently of META_CONTENT_TYPE: asserting only against the constant
20+
// the mounts also use proves the two mounts AGREE, but cannot catch the constant
21+
// itself being wrong. One literal here closes that loop.
22+
expect(META_CONTENT_TYPE).toBe("application/json; charset=utf-8");
1923
expect(res.headers["content-type"]).toBe(META_CONTENT_TYPE);
2024
expect(res.body).toBe(metaJson(root));
2125
});

0 commit comments

Comments
 (0)