import { describe, expect, it } from 'vitest'; import { resolveEndingState } from './endingResolver'; describe('endingResolver', () => { it('builds ending states from threads, companions, and factions', () => { const ending = resolveEndingState({ state: { storyEngineMemory: { activeThreadIds: ['thread-1', 'thread-2', 'thread-3'], }, } as never, companionResolutions: [ { characterId: 'archer-hero', resolutionType: 'bonded', summary: '她最终选择与你并肩到底。', relatedThreadIds: ['thread-1'], }, ], factionTensionStates: [ { factionId: 'faction:巡边司:1', temperature: 72, pressureSummary: '巡边司一线已经被旧案推到了临界点。', activeConflictThreadIds: ['thread-1'], }, ], }); expect(ending.endingType).toBe('bitter_sweet'); expect(ending.title).toBeTruthy(); }); });