0
.factory('Tag', function($window) {
var Context = {};
function reset() {
return Context !== {} ? Context : {};
}
return{
reset:reset
};
})
我做了測試這樣在工廠測試功能
describe('method: reset()', function(){
it('should reset the Context variable', function(){
spyOn(Tag, 'reset').andCallFake(function(){
return Context;
});
expect(Context).toEqual({});
});
afterEach(function(){
if(Context!== {}){
Context = {};
}
})
});
是,這個測試是準確的,如果是的話,爲什麼我的測試覆蓋率不增加..