Files
TREK/server/tests/integration/legacy-upgrade-v082.test.ts
T
Maurice 00cbc5aae3 test(server): src/config takes fixed test values from the setup file, so suites stop mocking it
tests/setup.ts mocks src/config once with tests/helpers/test-config.ts. A suite that needs other values calls overrideTestConfig(), and the setup file restores the defaults after every case. The 191 per-file factories are gone; config.test.ts takes the real module through vi.unmock, and the few suites that signed tokens with their own literal secret read it from TEST_CONFIG.
2026-10-10 20:16:10 +02:00

26 lines
1.0 KiB
TypeScript
Raw 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 82 boots on this release — tag v2.9.14, so seven of the eight migrations that are not replay-safe (steps 90–127) still lie ahead of it and must run for the first time rather than be skipped.
* 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-v082'));
});
vi.mock('../../src/websocket', () => ({
broadcast: vi.fn(),
broadcastToUser: vi.fn(),
getOnlineUserIds: vi.fn(() => []),
}));
describeLegacyUpgrade(
{ fixture: 'legacy-v082', version: 82, reseated: 1, nightOrderIndex: 1, id: 'LEGACYUP-082' },
legacyDb,
);