mirror of
https://github.com/eleith/emailjs.git
synced 2024-06-30 18:30:58 +00:00
test: use finally instead of then+catch
This commit is contained in:
parent
c43189fd00
commit
b76a198a93
|
@ -24,7 +24,7 @@ const send = (
|
|||
done: () => void
|
||||
) => {
|
||||
server.onData = (stream: Readable, _session, callback: () => void) => {
|
||||
mailparser.simpleParser(stream).then(verify).then(done).catch(done);
|
||||
mailparser.simpleParser(stream).then(verify).finally(done);
|
||||
stream.on('end', callback);
|
||||
};
|
||||
client.send(message, (err) => {
|
||||
|
|
|
@ -24,7 +24,7 @@ const send = (
|
|||
done: () => void
|
||||
) => {
|
||||
server.onData = (stream: Readable, _session, callback: () => void) => {
|
||||
mailparser.simpleParser(stream).then(verify).then(done).catch(done);
|
||||
mailparser.simpleParser(stream).then(verify).finally(done);
|
||||
stream.on('end', callback);
|
||||
};
|
||||
client.send(message, (err) => {
|
||||
|
|
|
@ -29,8 +29,7 @@ const send = (
|
|||
mailparser
|
||||
.simpleParser(stream, { skipTextLinks: true } as Record<string, unknown>)
|
||||
.then(verify)
|
||||
.then(done)
|
||||
.catch(done);
|
||||
.finally(done);
|
||||
stream.on('end', callback);
|
||||
};
|
||||
client.send(message, (err) => {
|
||||
|
|
Loading…
Reference in New Issue
Block a user