diff --git a/package-lock.json b/package-lock.json index 851641a..a6400f8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1380,6 +1380,7 @@ "version": "13.0.3", "resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-13.0.3.tgz", "integrity": "sha512-RbOBxmLBG8uvFUc15X9+9SFemKcQ0WBuISBVkpuiaUB2qblC8UWlHEjdWVoZ8AdhSwmoEgsiXKfopX0CQxaACQ==", + "hasInstallScript": true, "license": "MIT", "dependencies": { "node-addon-api": "^8.0.0" diff --git a/package.json b/package.json index dc36293..326dd86 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "api": "tsx server/index.ts", "build": "tsc -b && vite build", "typecheck:server": "tsc -p tsconfig.server.json", - "test": "tsx --test packages/game-core/index.test.ts", + "test": "tsx --test packages/game-core/index.test.ts src/ui-format.test.ts", "preview": "vite preview --host" }, "dependencies": { diff --git a/packages/game-core/index.test.ts b/packages/game-core/index.test.ts index 1dc7c3a..e02ab85 100644 --- a/packages/game-core/index.test.ts +++ b/packages/game-core/index.test.ts @@ -1,6 +1,6 @@ import assert from "node:assert/strict"; import test from "node:test"; -import { createPuzzle, dailyGame, replay, simulateFlight } from "./index.js"; +import { createPuzzle, dailyGame, replay, simulateFlight, stackBlockX } from "./index.js"; test("same seed creates the same puzzle", () => { assert.deepEqual(createPuzzle("reaction", "abc"), createPuzzle("reaction", "abc")); @@ -8,7 +8,7 @@ test("same seed creates the same puzzle", () => { }); test("daily rotation always selects a ranked challenge", () => { - const ranked = new Set(["reaction", "color", "whack", "flight", "pop", "memory"]); + const ranked = new Set(["reaction", "color", "whack", "flight", "pop", "memory", "stack"]); for (const day of ["2026-09-01", "2026-09-02", "2026-09-03", "2026-09-04", "2026-09-05"]) assert.equal(ranked.has(dailyGame(day)), true); }); @@ -99,16 +99,6 @@ test("flight: a bird that never flaps falls to the ground and cannot finish", () assert.equal(noFlap.completed, false); }); -test("flight: a bird that never flaps falls to the ground and cannot finish", () => { - const idle = replay("flight", "seed-flight", [{ t: 8000, type: "key", value: "flap" }]); - assert.equal(idle.valid, true); - assert.equal(idle.completed, false); - assert.equal(idle.score, 0); - // Even a late flap cannot grant a passed pipe once the bird hits the floor. - const noFlap = replay("flight", "seed-flight", []); - assert.equal(noFlap.completed, false); -}); - test("flight: live horizon verdict never projects a future ground death", () => { const puzzle = createPuzzle("flight", "seed-flight"); if (puzzle.gameId !== "flight") return;