Do you need spies to test if a function has been called in Jasmine?
问题 Am learning Jasmine, wondering if the following test would be valid? And if not, can someone explain why? I've been reading a number of tutorials and can't find a good explanation that has helped me understand why I can't seem to write a test like the one below correctly. // spec describe("when cart is clicked", function() { it("should call the populateNotes function", function() { $("#show-cart").click() expect(populateNotes()).toHaveBeenCalled(); }) }) // code $("#show-cart").click(function