diff --git a/src/samples/onitama/types.ts b/src/samples/onitama/types.ts index 044c52d..1022998 100644 --- a/src/samples/onitama/types.ts +++ b/src/samples/onitama/types.ts @@ -116,7 +116,8 @@ export function createPawns(){ export const prompts = { move: createPromptDef<[PlayerType, string, number, number, number, number]>( - 'move ' + 'move ', + '选择卡牌并移动棋子' ), }; diff --git a/tests/core/game.test.ts b/tests/core/game.test.ts index de82ff6..e8f3467 100644 --- a/tests/core/game.test.ts +++ b/tests/core/game.test.ts @@ -136,9 +136,12 @@ describe('createGameCommand', () => { describe('createPromptDef', () => { it('should create a PromptDef with string schema', () => { const promptDef = createPromptDef<[string, number]>('play '); - + expect(promptDef).toBeDefined(); - expect(promptDef.schema).toBe('play '); + expect(promptDef.schema.name).toBe('play'); + expect(promptDef.schema.params).toHaveLength(2); + expect(promptDef.schema.params[0].name).toBe('player'); + expect(promptDef.schema.params[1].name).toBe('score'); }); it('should create a PromptDef with CommandSchema object', () => {