test: add turn command state differential harness

This commit is contained in:
2026-07-25 11:38:42 +00:00
parent 0151055f94
commit 111d3c7074
16 changed files with 1200 additions and 31 deletions
@@ -0,0 +1,32 @@
import { describe, expect, it } from 'vitest';
import {
findTurnDifferentialWorkspaceRoot,
readReferenceDatabaseSnapshot,
} from '../src/turn-differential/referenceSnapshot.js';
const workspaceRoot = findTurnDifferentialWorkspaceRoot(process.cwd());
const integration = describe.skipIf(!workspaceRoot || process.env.TURN_DIFFERENTIAL_REFERENCE !== '1');
integration('legacy turn state snapshot adapter', () => {
it('exports a read-only canonical snapshot from the isolated reference service', () => {
const snapshot = readReferenceDatabaseSnapshot(workspaceRoot!, {
generalIds: [],
cityIds: [],
nationIds: [],
});
expect(snapshot).toMatchObject({
schemaVersion: 1,
engine: 'ref',
world: {
year: expect.any(Number),
month: expect.any(Number),
tickMinutes: expect.any(Number),
},
generals: [],
cities: [],
nations: [],
});
});
});