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

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

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

php - Cloud9 cloud IDE and CakePHP -