Files
TREK/server/tests/integration/legacy-upgrade-v205.test.ts
Maurice fa0edfd714 test(server): suites record broadcasts on a FakeRealtimeService instead of mocking src/websocket
A hand-built service gets a FakeRealtimeService where it took a RealtimeService, a Nest testing module overrides the provider, and a suite over buildApp() spies on the container's instance (spyOnRealtime). The 167 vi.mock factories on src/websocket are gone, RealtimeService reads the socket registry in ws-state.ts directly, and the re-export stub src/websocket.ts is deleted. The facade's own suite now checks what reaches a socket instead of which module function it called.
2026-10-10 20:16:10 +02:00

21 lines
835 B
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* B1 (Plan 4 final review): an install the retired positional runner migrated
* to schema_version 205 boots on this release — the released chain (main), so steps 206–242 run on it, including the booked-night reseat.
* The assertions live in tests/helpers/legacy-upgrade-suite.ts.
*/
import { db as legacyDb } from '../../src/db/database';
import { describeLegacyUpgrade } from '../helpers/legacy-upgrade-suite';
import { vi } from 'vitest';
vi.mock('../../src/db/database', async () => {
const { buildDbMock } = await import('../helpers/db-mock');
const { openLegacyFixture } = await import('../helpers/legacy-fixture');
return buildDbMock(openLegacyFixture('legacy-v205'));
});
describeLegacyUpgrade(
{ fixture: 'legacy-v205', version: 205, reseated: 1, nightOrderIndex: 1, id: 'LEGACYUP-205' },
legacyDb,
);