init with react+axum+spacetimedb
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
2026-04-26 18:06:23 +08:00
commit cbc27bad4a
20199 changed files with 883714 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
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();
});
});