Hey guys,
Im just start testing my meteor project. But I’m facing a problem when to test a Meteor.defer method used for email sending.
Just want to test this piece of code on server side:
Wouldn’t it be simpler just to stub Accounts.sendVerificationEmail and execute done() right after it ?
Especially that you don’t really want to call that method inside your test! Since it may send out an email.
If you want to mock Accounts, you should think about using dependency injection in your service: