Files
Genarrative/src/services/storyEngine/campaignPackCompiler.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

25 lines
882 B
TypeScript

import { describe, expect, it } from 'vitest';
import { type CustomWorldProfile } from '../../types';
import { compileCampaignFromWorldProfile } from './campaignPackCompiler';
describe('campaignPackCompiler', () => {
it('builds scenario and campaign packs from a world profile', () => {
const profile = {
id: 'world-1',
name: '裂潮边城',
scenarioPackId: 'scenario-pack:rift',
campaignPackId: 'campaign-pack:rift-main',
storyGraph: {
visibleThreads: [{ id: 'thread-1', title: '封桥旧案' }],
},
playableNpcs: [{ id: 'npc-1', templateCharacterId: 'archer-hero' }],
} as unknown as CustomWorldProfile;
const compiled = compileCampaignFromWorldProfile({ profile });
expect(compiled.scenarioPack.id).toBe('scenario-pack:rift');
expect(compiled.campaignPack.id).toBe('campaign-pack:rift-main');
});
});