fix(tests): Update test assertions and refine service interfaces

This commit is contained in:
2025-05-07 22:06:55 +00:00
parent 630e911589
commit 7e931d6c52
18 changed files with 391 additions and 105 deletions

View File

@ -25,10 +25,10 @@ tap.test('verify that SenderReputationMonitor and IPWarmupManager are functionin
reputationMonitor.recordSendEvent('example.com', { type: 'delivered', count: 95 });
const reputationData = reputationMonitor.getReputationData('example.com');
expect(reputationData).to.not.be.null;
expect(reputationData).toBeTruthy();
const summary = reputationMonitor.getReputationSummary();
expect(summary.length).to.be.at.least(1);
expect(summary.length).toBeGreaterThan(0);
// Add and remove domains
reputationMonitor.addDomain('test.com');
@ -46,11 +46,11 @@ tap.test('verify that SenderReputationMonitor and IPWarmupManager are functionin
if (bestIP) {
ipWarmupManager.recordSend(bestIP);
const canSendMore = ipWarmupManager.canSendMoreToday(bestIP);
expect(typeof canSendMore).to.equal('boolean');
expect(typeof canSendMore).toEqual('boolean');
}
const stageCount = ipWarmupManager.getStageCount();
expect(stageCount).to.be.greaterThan(0);
expect(stageCount).toBeGreaterThan(0);
});
// Final clean-up test
@ -58,4 +58,8 @@ tap.test('clean up after tests', async () => {
// No-op - just to make sure everything is cleaned up properly
});
tap.test('stop', async () => {
await tap.stopForcefully();
});
export default tap.start();