refactor: adapter 구현중..

This commit is contained in:
DongHyeonka
2026-08-13 16:02:21 +09:00
parent 30ceac23c1
commit 4dc033cf33
72 changed files with 13370 additions and 1549 deletions
@@ -42,6 +42,25 @@ afterEach(async () => {
});
describe("validated JSON artifact writer", () => {
it("returns the exact schema-validated bytes used by durable publication", async () => {
const artifact = await import("../../scripts/lib/validated-json-artifact.ts") as
Record<string, unknown>;
expect(artifact.serializeValidatedJsonArtifact).toBeTypeOf("function");
const serializeValidatedJsonArtifact = artifact.serializeValidatedJsonArtifact as (
input: Readonly<{ path: string; schema: z.ZodType; value: unknown }>,
) => Buffer;
expect(serializeValidatedJsonArtifact({
path: "/unused/artifact.json",
schema: z.object({ value: z.string() }).strict(),
value: { value: "sealed" },
})).toEqual(Buffer.from('{\n "value": "sealed"\n}\n'));
expect(() => serializeValidatedJsonArtifact({
path: "/unused/artifact.json",
schema: z.object({ value: z.string() }).strict(),
value: { value: 7 },
})).toThrow();
});
it("syncs an O_NOFOLLOW exclusive temp and its directory around rename", async () => {
const events: string[] = [];
let openFlags = 0;