Block registry api

This commit is contained in:
2026-11-12 20:41:13 -03:00
parent e7fe663746
commit 76802ed430
39 changed files with 499 additions and 100 deletions
+2 -2
View File
@@ -88,13 +88,13 @@ Deno.test("a mod's model can use the base game's templates as its parent", async
Deno.removeSync(dir, { recursive: true });
});
Deno.test("check-mods reports a parent that doesn't exist and parents that loop", () => {
Deno.test("check-mods reports a parent that doesn't exist and parents that loop", async () => {
const dir = mods_with({
orphan: { id: "copper_tools:orphan", parent: "copper_tools:nowhere" },
one: { id: "copper_tools:one", parent: "copper_tools:two" },
two: { id: "copper_tools:two", parent: "copper_tools:one" },
});
const errors = load_and_check(dir).find((mod) => mod.id === "copper_tools")!.report.errors.join("\n");
const errors = (await load_and_check(dir)).find((mod) => mod.id === "copper_tools")!.report.errors.join("\n");
assert(errors.includes("model copper_tools:nowhere doesn't exist"), errors);
assert(errors.includes("copper_tools:one's parents loop"), errors);
Deno.removeSync(dir, { recursive: true });