0
我想測試Jasmine的toHaveBeenCalled()匹配器。 我SRC:錯誤spyOn toHaveBeenCalled在模型測試
function myModel(){
}
myModel.prototype.getObjcts = function(){
return DS.findAll('obj', {});
}
還有茉莉花測試:
describe('findAll', function(){
it('check calling findAll()', function(){
spyOn(DS, 'findAll');
myModel.getObjcts();
expect(DS.findAll('obj', {})).toHaveBeenCalled();
});
});
但我得到預期的間諜錯誤
,卻得到了不確定
時請,幫助我瞭解問題出在哪裏