My Karma coverage report shows to cover the local variable. is that possible or its a karma-coverage
report issue.
Please have a look at the Angular Controller Code.
'use strict';
angular.module('moduleName')
.controller('FormController', [ '$log',
function FormController($log) {
// Controller Local Variables.
var that = this;
that.hideLoader = function () {
that.isLoading = false;
};
}
]);
My Question: Is that possible to cover the local variables and function parameter conditions. for instance is below.
that.hideLoader = function (userObj) {
var id = userObj.id;
if(id) {
that.isLoading = false;
}
else {
that.isError = true;
}
};
In the above example, I have declared user object id attribute to local id
variable. now its very tough to cover the code. in this case, jasmine advise to reduce local variable or its karma-coverage report suggestion ?