我的茉莉花测试失败了:
"nunjucks -w -u '*.tpl' -o ./"
如何将模拟对象转换为模拟资源对象?
答案 0 :(得分:0)
使用自定义茉莉花匹配器代替toEqual:
Jasmine 1:
beforeEach(function() {
this.addMatchers({
toEqualData: function(expect) {
return angular.equals(expect, this.actual);
}
});
});
Jasmine 2:
beforeEach(function(){
jasmine.addMatchers({
toEqualData: function() {
return {
compare: function(actual, expected) {
return { pass: angular.equals(actual, expected) };
}
};
}
});
});
来源:How do I get a resource from an Angular.js module for a jasmine test (来自Misko Hevery,角度的创造者)