syntaxai/tdd.md · commit 3b30eb5

red: spec parser surfaces unknown games clearly

Asserts loadGame("does-not-exist") rejects with a message matching
/unknown game: does-not-exist/. Currently the dynamic import leaks
"Cannot find module ../content/games/does-not-exist/spec.ts ..." which
is implementation-detail garbage. Next green will catch the import
miss and throw a clean, identity-shaped error.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
author
syntaxai <[email protected]>
date
2026-05-03 16:34:48 +01:00
parent
3d65afd
commit
3b30eb5cfa2a5ed7840e01c304523fc8cc15bf6b

1 file changed · +6 −0

modified src/games.test.ts +6 −0
@@ -18,3 +18,9 @@ test("loadGame returns the kata's step ids in order", async () => {
1818 "negatives-throw",
1919 ]);
2020 });
21+
22+test("loadGame throws a clear error for an unknown game", async () => {
23+ await expect(loadGame("does-not-exist")).rejects.toThrow(
24+ /unknown game: does-not-exist/,
25+ );
26+});