Created
December 26, 2018 14:07
-
-
Save goldbergyoni/fab6112a9e0dbe0c6333ba82a2f8a495 to your computer and use it in GitHub Desktop.
Spies
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
| it("When a valid product is about to be deleted, ensure an email is sent", async () => { | |
| //Assume we already added here a product | |
| const spy = sinon.spy(Emailer.prototype, "sendEmail"); | |
| new ProductService().deletePrice(theProductWeJustAdded); | |
| //hmmm OK: we deal with internals? Yes, but as a side effect of testing the requirements (sending an email) | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment