Skip to content

Instantly share code, notes, and snippets.

@kscc25
Last active June 13, 2016 08:30
Show Gist options
  • Save kscc25/e93525c3a4a34ac8f82c7306281bdd25 to your computer and use it in GitHub Desktop.
Save kscc25/e93525c3a4a34ac8f82c7306281bdd25 to your computer and use it in GitHub Desktop.
// Bad
.factory('sendEmail', function() {
return function () {....};
})
// mock ???
// Good
.factory('emailService', function() {
return {
sendEmail: sendEmail
};
})
// mock
emailService.sendEmail = ...
sinon.spy(emailService, 'sendEmail');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment