This commit is contained in:
2025-05-25 19:02:18 +00:00
parent 5b33623c2d
commit 4c9fd22a86
20 changed files with 1551 additions and 1451 deletions

View File

@ -1,5 +1,5 @@
import { tap, expect } from '@git.zone/tstest/tapbundle';
import { startTestSmtpServer } from '../../helpers/server.loader.js';
import { startTestServer, stopTestServer, type ITestServer } from '../../helpers/server.loader.js';
import * as dns from 'dns';
import { promisify } from 'util';
@ -7,12 +7,16 @@ const resolveMx = promisify(dns.resolveMx);
const resolve4 = promisify(dns.resolve4);
const resolve6 = promisify(dns.resolve6);
let testServer: any;
let testServer: ITestServer;
tap.test('setup test SMTP server', async () => {
testServer = await startTestSmtpServer();
testServer = await startTestServer({
port: 2534,
tlsEnabled: false,
authRequired: false
});
expect(testServer).toBeTruthy();
expect(testServer.port).toBeGreaterThan(0);
expect(testServer.port).toEqual(2534);
});
tap.test('CCM-08: DNS resolution and MX record lookup', async () => {
@ -128,8 +132,8 @@ tap.test('CCM-08: Multiple A record handling', async () => {
tap.test('cleanup test SMTP server', async () => {
if (testServer) {
await testServer.stop();
await stopTestServer(testServer);
}
});
export default tap.start();
tap.start();