diff --git a/app/game-engine/test/monthlyCatalogCoverage.test.ts b/app/game-engine/test/monthlyCatalogCoverage.test.ts index 4db06a99..4329bfce 100644 --- a/app/game-engine/test/monthlyCatalogCoverage.test.ts +++ b/app/game-engine/test/monthlyCatalogCoverage.test.ts @@ -4,7 +4,6 @@ import path from 'node:path'; import { fileURLToPath } from 'node:url'; import { describe, expect, it } from 'vitest'; -import { resolveScenarioDefaultsPath } from '../src/scenario/scenarioLoader.js'; import { MONTHLY_EVENT_ACTION_CATALOG, type MonthlyEventActionName } from '../src/turn/monthlyEventHandler.js'; import { hasRefSourceRoot, resolveRefSourceRoot } from './refSourceRoot.js'; @@ -136,7 +135,6 @@ const segments = [ }, ] as const satisfies readonly CatalogSegment[]; -const KNOWN_MISSING_SCENARIO_RESOURCES = [] as const; const KNOWN_MISSING_MONTHLY_ACTIONS = [] as const; const listBasenames = async (directory: string, pattern: RegExp): Promise => diff --git a/app/game-engine/test/unificationInvaderResume.test.ts b/app/game-engine/test/unificationInvaderResume.test.ts index 2532fe11..e9b04cdc 100644 --- a/app/game-engine/test/unificationInvaderResume.test.ts +++ b/app/game-engine/test/unificationInvaderResume.test.ts @@ -234,14 +234,19 @@ describe('HWE-shaped unification invader resume', () => { loadArchivedNationMaxId: async () => 57, }); const processor = new InMemoryTurnProcessor(world); + const clock = new ManualClock(acceptedAt.getTime()); const run = vi.fn(async (...args: Parameters) => { const result = await processor.run(...args); - queue.enqueue({ type: 'shutdown', reason: 'one resumed monthly boundary verified' }); + if (world.getState().currentMonth === 4) { + queue.enqueue({ type: 'shutdown', reason: 'resumed monthly boundary verified' }); + } else { + clock.advanceMs(2_000); + } return result; }); const lifecycle = new TurnDaemonLifecycle( { - clock: new ManualClock(acceptedAt.getTime()), + clock, controlQueue: queue, getNextTickTime: (value) => addMinutes(value, 1), stateStore: new InMemoryTurnStateStore(world), @@ -270,7 +275,11 @@ describe('HWE-shaped unification invader resume', () => { }); expect(world.listNations().filter((entry) => entry.name.startsWith('ⓞ'))).toHaveLength(1); expect(world.listGenerals().filter((entry) => entry.npcState === 9)).toHaveLength(10); - expect(run).toHaveBeenCalledOnce(); - expect(lifecycle.getStatus().lastTurnTime).toBe('2026-08-19T21:15:00.000Z'); + expect(run).toHaveBeenCalledTimes(2); + expect(run.mock.calls.map(([targetTime]) => targetTime.toISOString())).toEqual([ + '2026-08-20T06:24:58.611Z', + '2026-08-20T06:25:00.000Z', + ]); + expect(lifecycle.getStatus().lastTurnTime).toBe('2026-08-20T06:25:00.000Z'); }); });