Jasmine - expected parameter -
this first time looking @ jasmine , tdd in general. experimenting jasmine @ minute , have written function console logs passed in parameter. writing test ensures function called necessary parameter.
describe("get suggestions function", function(){ it("should have parameter - value", function(){ expect(getsuggestions).tothrow(); }); });
the above code passes in jasmine's specrunner, unsure if correct method of testing.
you can use tohavebeencalledwith function in jasmine working.
you'll need spy on getsuggestions function , like
it("tracks spy called", function() { expect(getsuggestions).tohavebeencalledwith('foobar'); });
Comments
Post a Comment