Skip to content

Instantly share code, notes, and snippets.

@FREEZX
Last active January 23, 2020 23:40
Show Gist options
  • Select an option

  • Save FREEZX/e8e2e6235eb6a258a4c1c90d5ca01891 to your computer and use it in GitHub Desktop.

Select an option

Save FREEZX/e8e2e6235eb6a258a4c1c90d5ca01891 to your computer and use it in GitHub Desktop.
import nodemailer from 'nodemailer';
import nodemailerMock from 'nodemailer-mock';
import config from './config';
/**
* Mailer config
*/
let transporter;
if(process.env.NODE_ENV === 'test') {
transporter = nodemailerMock.createTransport(config.mailer);
} else {
transporter = nodemailer.createTransport(config.mailer);
}
export default transporter;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment