Last active
June 13, 2016 08:30
-
-
Save kscc25/e93525c3a4a34ac8f82c7306281bdd25 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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