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,7 +1,7 @@
import * as plugins from '@git.zone/tstest/tapbundle';
import { expect, tap } from '@git.zone/tstest/tapbundle';
import * as net from 'net';
import { startTestServer, stopTestServer } from '../server.loader.js';
import { startTestServer, stopTestServer } from '../../helpers/server.loader.js';
const TEST_PORT = 2525;
@ -73,7 +73,7 @@ tap.test('REL-05: DNS resolution failure handling - Non-existent domains', async
const mailFromHandled = mailResponse.includes('250') ||
mailResponse.includes('450') ||
mailResponse.includes('550');
expect(mailFromHandled).toBeTrue();
expect(mailFromHandled).toEqual(true);
// Reset if needed
if (mailResponse.includes('250')) {
@ -108,7 +108,7 @@ tap.test('REL-05: DNS resolution failure handling - Non-existent domains', async
const rcptToHandled = rcptResponse.includes('450') || // Temporary failure
rcptResponse.includes('550') || // Permanent failure
rcptResponse.includes('553'); // Address error
expect(rcptToHandled).toBeTrue();
expect(rcptToHandled).toEqual(true);
socket.write('QUIT\r\n');
socket.end();
@ -182,7 +182,7 @@ tap.test('REL-05: DNS resolution failure handling - Malformed domains', async (t
response.includes('553'); // Address error
console.log(` Response: ${response.trim().substring(0, 50)}`);
expect(properlyHandled).toBeTrue();
expect(properlyHandled).toEqual(true);
// Reset if needed
if (!response.includes('5')) {
@ -266,7 +266,7 @@ tap.test('REL-05: DNS resolution failure handling - Special cases', async (tools
console.log(' IP address response:', ipResponse.trim());
const ipHandled = ipResponse.includes('250') || ipResponse.includes('501');
expect(ipHandled).toBeTrue();
expect(ipHandled).toEqual(true);
socket.write('RSET\r\n');
await new Promise<void>((resolve) => {
@ -368,7 +368,7 @@ tap.test('REL-05: DNS resolution failure handling - Mixed valid/invalid recipien
const invalidHandled = invalidRcptResponse.includes('450') ||
invalidRcptResponse.includes('550') ||
invalidRcptResponse.includes('553');
expect(invalidHandled).toBeTrue();
expect(invalidHandled).toEqual(true);
// Try to send data (should work if at least one valid recipient)
socket.write('DATA\r\n');