| 1 | import test from "node:test"; |
| 2 | import assert from "node:assert/strict"; |
| 3 | import { readFileSync } from "node:fs"; |
| 4 | import { fileURLToPath } from "node:url"; |
| 5 | import { dirname, join } from "node:path"; |
| 6 | |
| 7 | const root = join(dirname(fileURLToPath(import.meta.url)), ".."); |
| 8 | |
| 9 | test("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 | }); |