Files
Genarrative/src/services/storyEngine/storySimulationRunner.test.ts
高物 ddcb5d5c8c
Some checks failed
CI / verify (push) Has been cancelled
Rework story engine flow and reorganize project docs
2026-04-06 23:19:00 +08:00

55 lines
1.5 KiB
TypeScript

import { describe, expect, it } from 'vitest';
import { runStorySimulation } from './storySimulationRunner';
describe('storySimulationRunner', () => {
it('creates a deterministic simulation result', () => {
const result = runStorySimulation({
scenarioPackId: 'scenario-1',
campaignPack: {
id: 'campaign-1',
scenarioPackId: 'scenario-1',
title: 'Campaign',
authoringStyle: 'classic',
campaignStateSeed: {
id: 'campaign-state',
title: 'Campaign',
currentActId: 'act-1',
currentActIndex: 0,
},
actTemplates: [],
requiredCompanionIds: [],
},
memory: {
activeThreadIds: ['a', 'b'],
companionResolutions: [
{
characterId: 'archer-hero',
resolutionType: 'estranged',
summary: '离心',
relatedThreadIds: [],
},
],
endingState: {
id: 'ending-1',
title: '结局',
endingType: 'heroic',
summary: '达成',
contributingThreadIds: [],
companionResolutions: [],
worldOutcomeSummary: '稳定',
},
narrativeQaReport: {
generatedAt: new Date().toISOString(),
issues: [{ id: 'issue-1', severity: 'low', category: 'pacing', summary: 'ok', relatedIds: [] }],
summary: '有 1 条 QA 问题',
},
} as never,
seed: 'baseline',
});
expect(result.endingId).toBe('ending-1');
expect(result.issueCount).toBe(1);
});
});