This commit is contained in:
2025-05-23 21:20:39 +00:00
parent 9629329bc2
commit 0907949f8a
86 changed files with 654 additions and 569 deletions

View File

@ -110,7 +110,7 @@ export async function startTestServer(config: ITestServerConfig): Promise<ITestS
const smtpServer = await createSmtpServer(mockEmailServer, smtpOptions);
// Start the server
await smtpServer.start();
await smtpServer.listen();
// Wait for server to be ready
await waitForServerReady(serverConfig.hostname, serverConfig.port);
@ -140,12 +140,8 @@ export async function stopTestServer(testServer: ITestServer): Promise<void> {
console.log(`🛑 Stopping test SMTP server on ${testServer.hostname}:${testServer.port}`);
// Stop the SMTP server
if (testServer.smtpServer.stop && typeof testServer.smtpServer.stop === 'function') {
await testServer.smtpServer.stop();
} else if (testServer.smtpServer.close && typeof testServer.smtpServer.close === 'function') {
await new Promise<void>((resolve) => {
testServer.smtpServer.close(() => resolve());
});
if (testServer.smtpServer.close && typeof testServer.smtpServer.close === 'function') {
await testServer.smtpServer.close();
}
// Wait for port to be free