Files
minecraft-account-manager/apps/web/src/lib/openapi-serving.test.ts
T
dmg 47782b3ccc
CI / validate (push) Successful in 7m15s
Release / release (push) Successful in 11m32s
feat(api): publish validated OpenAPI contract
2026-09-10 15:11:57 -04:00

12 lines
544 B
TypeScript

import { readFileSync } from "node:fs";
import { resolve } from "node:path";
import { expect, it } from "vitest";
import { GET } from "../app/openapi.yaml/route";
it("serves the canonical YAML bytes publicly, without rewriting or authentication", async () => {
const response = await GET();
expect(response.status).toBe(200);
expect(response.headers.get("content-type")).toBe("application/yaml; charset=utf-8");
expect(Buffer.from(await response.arrayBuffer())).toEqual(readFileSync(resolve(process.cwd(), "../../openapi.yaml")));
});