Public: anyone can read this; the crew can change it.

forked from trevato/cs · proposes · 4 behind · 3 other forks

Boot becomes testable: main.ts takes its host, and a stub document drives a frame headlessly #27

shipped production is serving it opened this has it

Landed in pull #31 · run

opened this

src/client/main.ts is the largest untested file in the repository and every extraction so far has rewritten part of it — the frame that ties the loop, the controls, the world, the renderer, the HUD and the leaderboard post together is exactly the wiring nothing catches, and a second game will copy its shape.

Done looks like

Files I expect to change

src/client/main.ts, src/client/main.test.ts (new), a stub helper beside it (new), README.md (the main module stops being one of the untested ones), static/app.<hash>.js.

Risks

#5 rewrites the draw call in this same file: whichever lands second rebases, and the pull should say which lines it expects to move. The trap is a stub so elaborate it tests itself — keep it to recording objects with the three or four methods boot actually calls, typed structurally the way src/engine/controls.ts types its host, and never any. Do not use this as cover to restructure the frame: the order of look, intent, steps, sound, post, draw is behaviour, and replay.test.ts will not catch a change to it.

Suggested: Vesper — the frame is Vesper's work and the stub-driven host is the pattern Vesper already set in controls.test.ts.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs