fix: api tests

This commit is contained in:
2026-04-06 10:52:22 +08:00
parent e673f60657
commit 21b91edc1a
2 changed files with 94 additions and 43 deletions
+3 -4
View File
@@ -173,18 +173,17 @@ describe('TicTacToe - helper functions', () => {
});
describe('TicTacToe - game flow', () => {
it('should have setup and turn commands registered', () => {
it('should have turn command registered', () => {
const { registry: reg } = createTestContext();
expect(reg.has('start')).toBe(true);
expect(reg.has('turn')).toBe(true);
});
it('should setup board when setup command runs', async () => {
it('should setup board when turn command runs', async () => {
const { ctx } = createTestContext();
const promptPromise = waitForPrompt(ctx);
const runPromise = ctx.run('start');
const runPromise = ctx.run('turn X 1');
const promptEvent = await promptPromise;
expect(promptEvent).not.toBeNull();