mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-25 22:27:32 +00:00
fix(server): plan 3a review follow-ups — fail closed without an ORM at every choke point; seam and D5 ratchet tests; dead method and DDL copies removed
This commit is contained in:
@@ -82,6 +82,11 @@ function makeJob(over: Partial<Setup> = {}) {
|
||||
return setup.registrarEnabled;
|
||||
}),
|
||||
unregister: vi.fn(),
|
||||
// task-6-fix-brief.md item 7: the boot-time banner read now runs through
|
||||
// CronRegistrarService.runOnBoot instead of directly inline — this
|
||||
// double just runs fn immediately, reproducing the pre-fix behaviour
|
||||
// exactly, so every existing assertion below is unaffected.
|
||||
runOnBoot: vi.fn(async (_name: string, fn: () => void | Promise<void>) => { await fn(); }),
|
||||
};
|
||||
|
||||
// Both stubs carry the real signatures, so a case can read back which link a
|
||||
@@ -150,6 +155,12 @@ describe('DocSyncJob bootstrap', () => {
|
||||
await job.onApplicationBootstrap();
|
||||
expect(addons.isAddonEnabled).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('the boot-time interval banner goes through CronRegistrarService.runOnBoot (task-6-review-parity.md C1 — the boot-sweep choke point)', async () => {
|
||||
const { job, registrar } = makeJob({ interval: '90' });
|
||||
await job.onApplicationBootstrap();
|
||||
expect(registrar.runOnBoot).toHaveBeenCalledWith('docsync-boot', expect.any(Function));
|
||||
});
|
||||
});
|
||||
|
||||
describe('DocSyncJob tick', () => {
|
||||
|
||||
Reference in New Issue
Block a user