Something went wrong. Try again.
geometric packing game (tetris-ish) on an icosahedron
Something went wrong. Try again.
1.3 kB · 44 lines
TypeScript
at appview
123456789101112131415161718192021222324252627282930313233343536373839404142434445// Test fixture only: the normal application exposes no window-level game state.import { mountGame } from "../src/main";import { buildPlacements } from "../src/core/placements";import { Game as GameTestHarness } from "../src/core/game.testHelpers";
const runtime = await mountGame(document.getElementById("app")!);
if (!runtime) throw new Error("The browser game fixture failed to mount.");
const { game, session, view, audio } = runtime;
const fixtureGame = new GameTestHarness(session, game.board, buildPlacements(game.board));
// Keep private audio inspection at this test-only boundary. Indexed access retains// each field's actual type without widening the production class's public API.const audioProbe = { get enabled() { return audio.enabled; }, get playing() { return audio.playing; }, get context() { return audio["context"]; }, get source() { return audio["source"]; }, get gain() { return audio["gain"]; }, get placementBuffer() { return audio["placementBuffer"]; }, get invalidBuffer() { return audio["invalidBuffer"]; },};
const fixture = { game: fixtureGame, session, view, audio: audioProbe };
export type BrowserFixture = typeof fixture;
Object.assign(window, { __rad: fixture });