test: refactor and format test files

- Update `game.test.ts` to use `_ctx` when `this` is not required
- Fix type assertion in `boop.test.ts`
- Update `command-runner.test.ts` to use `parseCommandSchema` in prompt
  tests
- Reformat `middleware.test.ts` to use double quotes and consistent
  indentation
This commit is contained in:
2026-04-20 15:50:32 +08:00
parent 974c1a828c
commit 34cb828f60
4 changed files with 441 additions and 420 deletions
+6 -9
View File
@@ -60,15 +60,12 @@ describe("createGameContext", () => {
const registry = createGameCommandRegistry();
const ctx = createGameContext(registry);
registry.register(
"test <value>",
async function (this: CommandRunnerContext<IGameContext>, _ctx, value) {
return this.prompt(
createPromptDef("prompt <answer>"),
(answer) => answer,
);
},
);
registry.register("test <value>", async function (_ctx, value) {
return _ctx.prompt(
createPromptDef("prompt <answer>"),
(answer) => answer,
);
});
const promptPromise = new Promise<PromptEvent>((resolve) => {
ctx._commands.on("prompt", resolve);