BlueGit

timfa questward

Files

questward / client / tests / item-containers-view.test.js

item-containers-view.test.js

item-containers-view.test.js 731 B Download Raw
1import test from "node:test";
2import assert from "node:assert/strict";
3import { readFileSync } from "node:fs";
4import { fileURLToPath } from "node:url";
5import { dirname, join } from "node:path";
6
7const root = join(dirname(fileURLToPath(import.meta.url)), "..");
8
9test("WorldView defines play-time item container overlay APIs", () =>
10{
11 const src = readFileSync(join(root, "src/render/worldView.js"), "utf8");
12 // Method definitions (not mere call sites) — commit 4d19e1e wired calls without these.
13 assert.match(src, /^\tupsertItemContainer\s*\(/m);
14 assert.match(src, /^\tdespawnItemContainer\s*\(/m);
15 assert.match(src, /^\titemContainerAtTile\s*\(/m);
16 assert.match(src, /removeChunk[\s\S]*?despawnItemContainer\(id\)/);
17});