我的代码:
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");
});
但它失败了:
TypeError: foo bar baz in file:///D:/Java/AJUnittest/test/test-spec.js