mockmailer
A test framework agnostic mock for nodemailer allowing you to test code that sends mail via nodemailer without actually sending mail.
Obviously you'll need nodemailer
installed in your app that you're trying to test. This will use that version to prevent any oddities with two copies of nodemailer being present.
Usage
var test = test;var mockmailer = ;var nodemailer = ; ; ;
Installation
npm i -D mockmailer
API
function(registeredCallback)
mockmailer → /**
* Supply a callback to be invoked when mail is sent that resolves or fails your test
* @method mockmailer
* @async
* @param {function} registeredCallback The callback to invoke when `sendMail` is called
* @returns {object} undefined
*/
function(fail)
setFail → /**
* Sets nodemailer to either fail or not when `sendMail` is called
* @method setFail
* @param {boolean} mode Should nodemailer "fail" sending mail
*/
License
mockmailer is ©2014 Scripto, LLC. Available for use under the MIT License.