how to write a jasmine spec for triggering a on event in jquery ?
$('#myid').on('keyup', function (event)
{
if(event.which === 13)
{
event.preventDefault();
myfunc(id);
}
});
those lines are not covered by jasmine spec how to write jasmine specs for those lines. only triggering event didnt cover those lines so help me here
I don't know how you wrote your spec but try the below code
If it still doesn't work, try using a separate named function instead of anonymous function as follows: