我正在使用Jasmine为一个Angular应用编写测试用例。但是许多服务的内部方法被声明为私有的。
例如:
App.service('productDisplay', function(){
var myPrivate = function(){
//do sth
}
this.doOfferCal = function(product, date){
//call myPrivate
//do sth too
return offer;
}
});
使用Jasmine编写“doOfferCal”的测试代码很简单,但我想为"myPrivate"编写单元测试。 我该怎么做呢? 预先感谢您的帮助。