Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> git-subtree-dir: gti-maquina-comercial git-subtree-mainline:93ca82979egit-subtree-split:b77484946f
13 lines
484 B
JavaScript
13 lines
484 B
JavaScript
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();
|
|
});
|