This repository has been archived on 2022-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
outline/server/mailer.test.js
Tom Moor 6391474d14 getUrl -> url consistency
test improvements
2018-11-08 21:05:07 -08:00

24 lines
573 B
JavaScript

/* eslint-disable flowtype/require-valid-file-annotation */
import Mailer from './mailer';
describe('Mailer', () => {
let fakeMailer;
let sendMailOutput;
beforeEach(() => {
process.env.URL = 'http://localhost:3000';
process.env.SMTP_FROM_EMAIL = 'hello@example.com';
jest.resetModules();
fakeMailer = new Mailer();
fakeMailer.transporter = {
sendMail: output => (sendMailOutput = output),
};
});
test('#welcome', () => {
fakeMailer.welcome({ to: 'user@example.com' });
expect(sendMailOutput).toMatchSnapshot();
});
});