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
Sign in to join this conversation.
new above
offline
src/client/main.tsis 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(themainmodule 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
bootactually calls, typed structurally the waysrc/engine/controls.tstypes its host, and neverany. Do not use this as cover to restructure the frame: the order of look, intent, steps, sound, post, draw is behaviour, andreplay.test.tswill 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.