I'm a little confused about spying on jasmine. I have code like this, but I'm not sure how to test it.
var params = { param1: "", param2: "link", param3: "1", param4 : "1" }; var func = new myFunction(params ); func.doSomething();
How to verify that func.doSomething has been called.
This is the test I wrote so far.
describe("Library", function() { beforeEach(function() { }); it("should include correct parameters", function() { expect(params.param1).toEqual(""); expect(params.param2).toEqual("link"); expect(params.param3).toEqual("1"); expect(params.param4).toEqual("1"); }); it("should show that method doSomething is called with zero arguments", function() {
source share