karma jasmine - Unit Test for div function -


my code:

it('div function', function() {      var bar = function(a,b) {     if(b==0){     throw new typeerror("foo bar baz");     }else return a/b;     };     expect(bar(0,0)).tothrowerror("foo bar baz");   }); 

but fail:

typeerror: foo bar baz in file:///d:/java/ajunittest/test/test-spec.js 


Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - How to Hide Date Menu from Datepicker in yii2 -