This commit is contained in:
2025-05-22 10:18:02 +00:00
parent 7c0f9b4e44
commit ac419e7b79
21 changed files with 4541 additions and 1868 deletions

View File

@ -1,7 +1,7 @@
import { tap, expect } from '@git.zone/tstest/tapbundle';
import * as plugins from '../ts/plugins.js';
import * as paths from '../ts/paths.js';
import { SMTPServer } from '../ts/mail/delivery/classes.smtpserver.js';
import { createSmtpServer } from '../ts/mail/delivery/smtpserver/index.js';
import { UnifiedEmailServer } from '../ts/mail/routing/classes.unified.email.server.js';
import { Email } from '../ts/mail/core/classes.email.js';
import type { ISmtpServerOptions } from '../ts/mail/delivery/interfaces.js';
@ -29,7 +29,7 @@ tap.test('verify SMTP server initialization', async () => {
};
// Create SMTP server instance
const smtpServer = new SMTPServer(mockEmailServer, options);
const smtpServer = createSmtpServer(mockEmailServer, options);
// Verify instance was created correctly
expect(smtpServer).toBeTruthy();
@ -62,7 +62,7 @@ tap.test('verify SMTP server listen method', async () => {
};
// Create SMTP server instance
const smtpServer = new SMTPServer(mockEmailServer, options);
const smtpServer = createSmtpServer(mockEmailServer, options);
// Mock net.Server.listen and net.Server.close to avoid actual networking
const originalListen = smtpServer.server.listen;
@ -118,7 +118,7 @@ tap.test('verify SMTP server error handling', async () => {
};
// Create SMTP server instance
const smtpServer = new SMTPServer(mockEmailServer, options);
const smtpServer = createSmtpServer(mockEmailServer, options);
// Mock server.listen to simulate an error
const originalListen = smtpServer.server.listen;