15 lines
595 B
TypeScript
15 lines
595 B
TypeScript
import { describe, expect, test } from "bun:test";
|
|
import pino from "pino";
|
|
import { healthResponseSchema } from "@great-agent/web-contracts";
|
|
import { createApp } from "./create-app";
|
|
|
|
describe("Web Server 骨架", () => {
|
|
test("健康检查返回约定格式和请求标识", async () => {
|
|
const app = createApp(pino({ enabled: false }));
|
|
const response = await app.request("/api/health");
|
|
expect(response.status).toBe(200);
|
|
expect(response.headers.get("X-Request-ID")).toBeTruthy();
|
|
expect(healthResponseSchema.parse(await response.json()).status).toBe("ok");
|
|
});
|
|
});
|