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
Post a Comment