Wire campaign scheduler into server boot

This commit is contained in:
Gustavo
2026-08-03 08:13:45 -03:00
parent a9509a4691
commit 4835c6e085
3 changed files with 39 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { openDb } from '../src/db.mjs';
import { startCampaignScheduler } from '../src/outreach/campaign-scheduler.mjs';
test('startCampaignScheduler retorna funcao de parada que limpa os timers sem lancar erro', () => {
const db = openDb(':memory:');
const stop = startCampaignScheduler({ db, log: () => {} });
assert.equal(typeof stop, 'function');
assert.doesNotThrow(() => stop());
db.close();
});