Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
14 changes: 2 additions & 12 deletions packages/game-core/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
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"));
assert.notDeepEqual(createPuzzle("reaction", "abc"), createPuzzle("reaction", "def"));
});

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);
});

Expand Down Expand Up @@ -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;
Expand Down
Loading