chore: initialize from frontend template 4dc033c

This commit is contained in:
DongHyeonka
2026-08-13 18:23:26 +09:00
commit 40107eec84
897 changed files with 234824 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
import { describe, expect, it } from "vitest";
import {
BOOT_JSON_POLICIES,
readBoundedBootJson,
} from "../../src/bootstrap/read-bounded-boot-json.ts";
describe("bounded boot JSON admission", () => {
it("does not call fetch when the caller signal is already aborted", async () => {
const caller = new AbortController();
caller.abort();
let fetchCalls = 0;
const outcome = await readBoundedBootJson(
"/config.json",
BOOT_JSON_POLICIES.RUNTIME_CONFIG,
{
signal: caller.signal,
fetcher: async () => {
fetchCalls += 1;
return new Response("{}", {
headers: { "content-type": "application/json" },
});
},
},
);
expect(fetchCalls).toBe(0);
expect(outcome).toEqual({ ok: false, failure: "FETCH_FAILED" });
});
});