This commit is contained in:
2025-05-26 14:50:55 +00:00
parent 20583beb35
commit a3721f7a74
22 changed files with 2820 additions and 8112 deletions

View File

@ -1,7 +1,7 @@
import { expect, tap } from '@git.zone/tstest/tapbundle';
import * as plugins from './plugins.js';
import { createTestServer } from '../../helpers/server.loader.js';
import { createSmtpClient } from '../../helpers/smtp.client.js';
import { createTestSmtpClient } from '../../helpers/smtp.client.js';
import { Email } from '../../../ts/index.js';
tap.test('CRFC-08: should handle SMTP extensions correctly (Various RFCs)', async (tools) => {
const testId = 'CRFC-08-smtp-extensions';
@ -78,7 +78,7 @@ tap.test('CRFC-08: should handle SMTP extensions correctly (Various RFCs)', asyn
}
});
const smtpClient = createSmtpClient({
const smtpClient = createTestSmtpClient({
host: testServer.hostname,
port: testServer.port,
secure: false
@ -90,7 +90,7 @@ tap.test('CRFC-08: should handle SMTP extensions correctly (Various RFCs)', asyn
binaryContent[i] = i % 256;
}
const email = new plugins.smartmail.Email({
const email = new Email({
from: 'sender@example.com',
to: ['recipient@example.com'],
subject: 'CHUNKING test',
@ -160,14 +160,14 @@ tap.test('CRFC-08: should handle SMTP extensions correctly (Various RFCs)', asyn
}
});
const smtpClient = createSmtpClient({
const smtpClient = createTestSmtpClient({
host: testServer.hostname,
port: testServer.port,
secure: false
});
// Test with delivery deadline
const email = new plugins.smartmail.Email({
const email = new Email({
from: 'sender@example.com',
to: ['urgent@example.com'],
subject: 'Urgent delivery test',
@ -624,14 +624,14 @@ tap.test('CRFC-08: should handle SMTP extensions correctly (Various RFCs)', asyn
}
});
const smtpClient = createSmtpClient({
const smtpClient = createTestSmtpClient({
host: testServer.hostname,
port: testServer.port,
secure: false
});
// Test email that could use multiple extensions
const email = new plugins.smartmail.Email({
const email = new Email({
from: 'sender@example.com',
to: ['recipient@example.com'],
subject: 'Extension combination test with UTF-8: 测试',
@ -651,4 +651,6 @@ tap.test('CRFC-08: should handle SMTP extensions correctly (Various RFCs)', asyn
})();
console.log(`\n${testId}: All ${scenarioCount} SMTP extension scenarios tested ✓`);
});
});
tap.start();