35 lines
1.2 KiB
TypeScript
35 lines
1.2 KiB
TypeScript
import { describe, expect, it } from 'vitest';
|
|
|
|
import { buildTelemetrySnapshot, captureNarrativeTelemetry } from './narrativeTelemetry';
|
|
|
|
describe('narrativeTelemetry', () => {
|
|
it('builds telemetry snapshots and summaries', () => {
|
|
const snapshot = buildTelemetrySnapshot({
|
|
memory: {
|
|
activeThreadIds: ['a', 'b'],
|
|
recentCompanionReactions: [{}, {}],
|
|
endingState: { id: 'ending-1' },
|
|
} as never,
|
|
qaReport: {
|
|
generatedAt: new Date().toISOString(),
|
|
issues: [{ id: 'issue-1', severity: 'medium', category: 'payoff', summary: 'missing', relatedIds: [] }],
|
|
summary: '1 issue',
|
|
},
|
|
});
|
|
|
|
expect(snapshot.averageActiveThreadCount).toBe(2);
|
|
expect(captureNarrativeTelemetry({
|
|
memory: {
|
|
activeThreadIds: ['a', 'b'],
|
|
recentCompanionReactions: [{}, {}],
|
|
endingState: { id: 'ending-1' },
|
|
} as never,
|
|
qaReport: {
|
|
generatedAt: new Date().toISOString(),
|
|
issues: [{ id: 'issue-1', severity: 'medium', category: 'payoff', summary: 'missing', relatedIds: [] }],
|
|
summary: '1 issue',
|
|
},
|
|
}).summary).toContain('平均活跃线程');
|
|
});
|
|
});
|