Block registry api
This commit is contained in:
+3
-3
@@ -259,11 +259,11 @@ async function setup() {
|
||||
return { ...t, dir };
|
||||
}
|
||||
|
||||
Deno.test("check-mods catches loot tables that point at nothing", () => {
|
||||
Deno.test("check-mods catches loot tables that point at nothing", async () => {
|
||||
const dir = Deno.makeTempDirSync({ prefix: "bworld_loot_check_" });
|
||||
copy_dir("mods/bworld", `${dir}/bworld`);
|
||||
loot_mod(dir);
|
||||
const ok = load_and_check(dir).find((mod) => mod.id === "testloot")!;
|
||||
const ok = (await load_and_check(dir)).find((mod) => mod.id === "testloot")!;
|
||||
assertEquals(ok.report.errors, []);
|
||||
assertEquals(ok.loot_tables.map((t) => t.json.id).sort(), [
|
||||
"testloot:blocks/ore",
|
||||
@@ -280,7 +280,7 @@ Deno.test("check-mods catches loot tables that point at nothing", () => {
|
||||
},
|
||||
}),
|
||||
);
|
||||
const errors = load_and_check(dir).find((mod) => mod.id === "testloot")!.report.errors;
|
||||
const errors = (await load_and_check(dir)).find((mod) => mod.id === "testloot")!.report.errors;
|
||||
assert(errors.some((e) => e.includes("item testloot:nothing doesn't exist")), errors.join("\n"));
|
||||
assert(errors.some((e) => e.includes("loot table testloot:nowhere doesn't exist")), errors.join("\n"));
|
||||
Deno.removeSync(dir, { recursive: true });
|
||||
|
||||
Reference in New Issue
Block a user