mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-05 02:14:05 +00:00
00cbc5aae3
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.
26 lines
1.0 KiB
TypeScript
26 lines
1.0 KiB
TypeScript
/**
|
|
* B1 (Plan 4 final review): an install the retired positional runner migrated
|
|
* to schema_version 242 boots on this release — the runner's last step, so only the post-legacy migrations run. Its booked night was left deliberately out of its seat: if the reseat (step 242) were replayed it would move.
|
|
* 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-v242'));
|
|
});
|
|
vi.mock('../../src/websocket', () => ({
|
|
broadcast: vi.fn(),
|
|
broadcastToUser: vi.fn(),
|
|
getOnlineUserIds: vi.fn(() => []),
|
|
}));
|
|
|
|
describeLegacyUpgrade(
|
|
{ fixture: 'legacy-v242', version: 242, reseated: 0, nightOrderIndex: 3, id: 'LEGACYUP-242' },
|
|
legacyDb,
|
|
);
|