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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user