feat: 메타 데이터에서 필수 killturn 값을 읽어오는 로직 추가 및 관련 함수 수정

This commit is contained in:
2026-01-25 05:26:40 +00:00
parent e89e758494
commit 340cadb8ce
6 changed files with 88 additions and 14 deletions
@@ -82,6 +82,14 @@ const defaultRunOptions = {
} satisfies Required<Omit<TurnHarnessRunOptions, 'minutes'>>;
export const createTurnTestHarness = async (options: TurnTestHarnessOptions) => {
const stateMeta = { ...options.state.meta } as Record<string, unknown>;
if (typeof stateMeta.killturn !== 'number' || !Number.isFinite(stateMeta.killturn)) {
stateMeta.killturn = 24;
}
const state: TurnWorldState = {
...options.state,
meta: stateMeta,
};
const mockPrisma = createMockPrisma();
const reservedTurnStore = new InMemoryReservedTurnStore(mockPrisma as any, {
maxGeneralTurns: 10,
@@ -126,7 +134,7 @@ export const createTurnTestHarness = async (options: TurnTestHarnessOptions) =>
...(options.extraCalendarHandlers ?? [])
);
const world = new InMemoryTurnWorldClass(options.state, options.snapshot, {
const world = new InMemoryTurnWorldClass(state, options.snapshot, {
schedule: options.schedule,
generalTurnHandler,
calendarHandler,