Phase0
Some checks failed
CI / Node — lint, typecheck, test, build (push) Failing after 9s
CI / Go — node-agent tests (push) Failing after 22s
CI / Go — edge-gateway build (push) Successful in 13s

This commit is contained in:
smueller
2026-06-26 11:12:51 +02:00
parent e25e871067
commit 4fe25e6ec3
106 changed files with 1002 additions and 160 deletions

View File

@@ -0,0 +1,16 @@
import { describe, expect, it } from "vitest";
import { problemDetailsSchema } from "./error";
describe("problemDetailsSchema", () => {
it("accepts RFC 7807 problem details", () => {
const result = problemDetailsSchema.safeParse({
type: "https://example.com/errors/validation",
title: "Validation failed",
status: 400,
detail: "Invalid input",
instance: "/api/v1/servers",
});
expect(result.success).toBe(true);
});
});

View File

@@ -0,0 +1,23 @@
import { describe, expect, it } from "vitest";
import { healthResponseSchema } from "./health";
describe("healthResponseSchema", () => {
it("accepts a valid liveness response", () => {
const result = healthResponseSchema.safeParse({
status: "ok",
service: "api",
timestamp: new Date().toISOString(),
});
expect(result.success).toBe(true);
});
it("rejects invalid status values", () => {
const result = healthResponseSchema.safeParse({
status: "unknown",
service: "api",
timestamp: new Date().toISOString(),
});
expect(result.success).toBe(false);
});
});