mirror of https://github.com/eleith/emailjs.git
smtp/connection: fix custom log fn assignment
This commit is contained in:
parent
9a5ce38186
commit
4f45799a3e
|
@ -183,7 +183,7 @@ export class SMTPConnection extends EventEmitter {
|
|||
this.password = () => password as string;
|
||||
|
||||
if (typeof logger === 'function') {
|
||||
this.log = log;
|
||||
this.log = logger;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
import test from 'ava';
|
||||
|
||||
import { SMTPConnection } from '../email.js';
|
||||
|
||||
test('accepts a custom logger', async (t) => {
|
||||
const logger = () => {
|
||||
/** ø */
|
||||
};
|
||||
const connection = new SMTPConnection({ logger });
|
||||
t.is(Reflect.get(connection, 'log'), logger);
|
||||
});
|
Loading…
Reference in New Issue