Files
outline/server/mailer.test.ts
Tom Moor 15b1069bcc chore: Move to Typescript (#2783)
This PR moves the entire project to Typescript. Due to the ~1000 ignores this will lead to a messy codebase for a while, but the churn is worth it – all of those ignore comments are places that were never type-safe previously.

closes #1282
2021-11-29 06:40:55 -08:00

26 lines
942 B
TypeScript

import mailer from "./mailer";
describe("Mailer", () => {
const fakeMailer = mailer;
// @ts-expect-error ts-migrate(7034) FIXME: Variable 'sendMailOutput' implicitly has type 'any... Remove this comment to see the full error message
let sendMailOutput;
beforeEach(() => {
process.env.URL = "http://localhost:3000";
process.env.SMTP_FROM_EMAIL = "hello@example.com";
jest.resetModules();
fakeMailer.transporter = {
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'output' implicitly has an 'any' type.
sendMail: (output) => (sendMailOutput = output),
};
});
test("#welcome", () => {
fakeMailer.welcome({
to: "user@example.com",
teamUrl: "http://example.com",
});
// @ts-expect-error ts-migrate(7005) FIXME: Variable 'sendMailOutput' implicitly has an 'any' ... Remove this comment to see the full error message
expect(sendMailOutput).toMatchSnapshot();
});
});