Files
outline/server/mailer.test.ts
2022-01-06 18:24:28 -08:00

24 lines
552 B
TypeScript

import mailer from "./mailer";
describe("Mailer", () => {
const fakeMailer = mailer;
let sendMailOutput: any;
beforeEach(() => {
process.env.URL = "http://localhost:3000";
process.env.SMTP_FROM_EMAIL = "hello@example.com";
jest.resetModules();
fakeMailer.transporter = {
sendMail: (output: any) => (sendMailOutput = output),
};
});
test("#welcome", () => {
fakeMailer.welcome({
to: "user@example.com",
teamUrl: "http://example.com",
});
expect(sendMailOutput).toMatchSnapshot();
});
});