dwyl / sendemail

💌 Simplifies reliably sending emails from your node.js apps using AWS Simple Email Service (SES)
181 stars 26 forks source link

Allowing for stubbable api #56

Closed samhstn closed 7 years ago

samhstn commented 7 years ago

This pr alters the api so that email is a method on the require(sendemail) object. This makes it possible to stub.

Fixes #55

@nelsonic This syntax:

var email = require('sendemail').email

Made it awkward to reference the other methods of sendemail. The pr now provides a stubbable interface, but accessing the other methods isn't that nice, I'm absolutely fine with redoing it another way or this may just be good to go.

Let me know your thoughts

codecov-io commented 7 years ago

Current coverage is 100% (diff: 100%)

Merging #56 into master will not change coverage

@@           master   #56   diff @@
===================================
  Files           1     1          
  Lines          29    30     +1   
  Methods         0     0          
  Messages        0     0          
  Branches        0     0          
===================================
+ Hits           29    30     +1   
  Misses          0     0          
  Partials        0     0          

Powered by Codecov. Last update aa51890...881b99d