19 lines
482 B
TypeScript
19 lines
482 B
TypeScript
const MailDev = require("maildev");
|
|
|
|
export const MAIL_SERVER = new MailDev({
|
|
ip: 'localhost',
|
|
});
|
|
|
|
export async function setupMailServer() {
|
|
await new Promise((resolve, reject) => MAIL_SERVER.listen((err: Error) => {
|
|
if (err) reject(err);
|
|
else resolve();
|
|
}));
|
|
};
|
|
|
|
export async function teardownMailServer() {
|
|
await new Promise((resolve, reject) => MAIL_SERVER.close((err: Error) => {
|
|
if (err) reject(err);
|
|
else resolve();
|
|
}));
|
|
}; |