mirror of https://github.com/eleith/emailjs.git
test/connection: catch server exceptions
This commit is contained in:
parent
dace0f0a6b
commit
f6bd3bb6a0
|
@ -10,8 +10,8 @@ let counter = 0;
|
|||
function testConnection(options: Partial<SMTPConnectionOptions> = {}) {
|
||||
const increment = counter++;
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
const { ssl } = options;
|
||||
const server = new SMTPServer(ssl ? { secure: true } : undefined);
|
||||
const server = new SMTPServer({ secure: options.ssl as boolean });
|
||||
server.on('error', (err) => reject(err));
|
||||
server.listen(port + increment, () => {
|
||||
const connection = new SMTPConnection(options);
|
||||
connection.connect((err) => {
|
||||
|
|
Loading…
Reference in New Issue