test: reformat and expand test coverage

This commit is contained in:
hypercross 2026-04-20 15:37:15 +08:00
parent b83ff28f60
commit 974c1a828c
3 changed files with 495 additions and 448 deletions

View File

@ -63,7 +63,10 @@ describe("createGameContext", () => {
registry.register( registry.register(
"test <value>", "test <value>",
async function (this: CommandRunnerContext<IGameContext>, _ctx, value) { async function (this: CommandRunnerContext<IGameContext>, _ctx, value) {
return this.prompt(createPromptDef("prompt <answer>"), () => "ok"); return this.prompt(
createPromptDef("prompt <answer>"),
(answer) => answer,
);
}, },
); );

View File

@ -23,7 +23,7 @@ function createTestItem(
id: string, id: string,
shapeStr: string, shapeStr: string,
transform = IDENTITY_TRANSFORM, transform = IDENTITY_TRANSFORM,
): InventoryItem { ): InventoryItem<Record<string, never>> {
const shape = parseShapeString(shapeStr); const shape = parseShapeString(shapeStr);
return { return {
id, id,

File diff suppressed because it is too large Load Diff