Extend tests for the real board and add tileEffects unit tests

game.test.js: rewritten for the new {type, rolls} action shape and 5-stat
player model. The full-playthrough test now walks the real 212-space board
turn by turn (deterministic dummy rolls — always the low end of each die's
range) until finish, asserting every stat stays numeric and every one of
the 9 real tile types actually gets resolved along the way. board-shape
assertions updated to match (212 spaces, no `choices` populated yet).

tileEffects.test.js (new): unit tests per tile type in isolation, including
exact deterministic assertions against real placeholder-table content (roll
a known value, assert the exact banded effect) and a multi-table
roll_table_ref cross-check computed independently from the raw table data —
no seeded-rng machinery anywhere, same explicit-action-value pattern the
reducer tests already used. Also a sweep resolving every real tile across
the full range of its die to catch any type/die combination that throws.

package.json: test script now runs shared/*.test.js instead of naming one
file.
This commit is contained in:
2026-07-28 10:08:37 -07:00
parent db82b531e0
commit 6749777b45
3 changed files with 172 additions and 32 deletions
+1 -1
View File
@@ -8,7 +8,7 @@
"scripts": {
"start": "node server/index.js",
"dev": "node --watch server/index.js",
"test": "node --test shared/game.test.js"
"test": "node --test shared/*.test.js"
},
"dependencies": {
"better-sqlite3": "^11.3.0",