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

Popular posts from this blog

angularjs - Showing an empty as first option in select tag -

python - argument 2 to map() must support iteration -

javafx - How to wait cancellation of task after Service#cancel? -