This commit is contained in:
2025-05-24 00:23:35 +00:00
parent 0907949f8a
commit cb52446f65
76 changed files with 1401 additions and 867 deletions

View File

@ -1,7 +1,6 @@
import { tap, expect } from '@git.zone/tapbundle';
import { tap, expect } from '@git.zone/tstest/tapbundle';
import * as net from 'net';
import { startTestServer, stopTestServer } from '../../helpers/server.loader.js';
import type { ITestServer } from '../../helpers/server.loader.js';
import { startTestServer, stopTestServer, type ITestServer } from '../../helpers/server.loader.js';
const TEST_PORT = 30036;
const TEST_TIMEOUT = 30000;
@ -13,7 +12,7 @@ tap.test('setup - start SMTP server for empty command tests', async () => {
port: TEST_PORT,
hostname: 'localhost'
});
expect(testServer).toBeInstanceOf(Object);
expect(testServer).toBeDefined();
});
tap.test('Empty Commands - should reject empty line (just CRLF)', async (tools) => {
@ -204,7 +203,7 @@ tap.test('Empty Commands - should reject MAIL FROM with empty parameter', async
// Should get syntax error (501 or 550)
expect(response).toMatch(/^5\d{2}/);
expect(response.toLowerCase()).toMatch(/syntax|parameter|address/);
expect(response).toMatch(/syntax|parameter|address/i);
// Clean up
socket.write('QUIT\r\n');
@ -265,7 +264,7 @@ tap.test('Empty Commands - should reject RCPT TO with empty parameter', async (t
// Should get syntax error
expect(response).toMatch(/^5\d{2}/);
expect(response.toLowerCase()).toMatch(/syntax|parameter|address/);
expect(response).toMatch(/syntax|parameter|address/i);
// Clean up
socket.write('QUIT\r\n');