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

@ -1,13 +1,15 @@
import { tap, expect } from '@git.zone/tstest/tapbundle';
import { startTestServer, stopTestServer, type ITestServer } from '../server.loader.js';
import { startTestServer, stopTestServer, type ITestServer } from '../../helpers/server.loader.js';
import type { SmtpServer } from '../../../ts/mail/delivery/smtpserver/index.js';
import { createConcurrentConnections, performSmtpHandshake, closeSmtpConnection } from '../../helpers/test.utils.js';
import { createConcurrentConnections, performSmtpHandshake, closeSmtpConnection } from '../../helpers/utils.js';
let testServer: SmtpServer;
const CONCURRENT_COUNT = 10;
tap.test('setup - start SMTP server', async () => {
testServer = await startTestServer();
testServer = await startTestServer({
port: 2526
});
await new Promise(resolve => setTimeout(resolve, 1000));
expect(testServer.port).toEqual(2526);
@ -101,7 +103,7 @@ tap.test('CM-02: Connection limit enforcement - verify max connections', async (
});
tap.test('cleanup - stop SMTP server', async () => {
await stopTestServer();
await stopTestServer(testServer);
console.log('✅ Test server stopped');
});