Yet another JS code coverage tool that computes statement, line, function and branch coverage with module loader hooks to transparently add coverage when running tests. Supports all JS coverage use cases including unit tests, server side functional tests and browser tests. Built for scale.
var o = {};
o.tmp = function(c){
return {
a : "model"
b : function(...){
c.add(function(){
....
});
c.add(function(){
....
});
}
}
}
o.tmp();
I understand that in this execution, the function "b" can not be executed. Using istanbul, I am getting following numbers :
Statements : 55.56% ( 5/9 )
Branches : 100% ( 0/0 )
Functions : 25% ( 1/4 )
Lines : 55.56% ( 5/9 )
I don't understand how 55% of the function is executed. Most of the code is covered with the function declaration of "b". Also, what does (5/9) means? What are the 9 statements here?
Thanks in advance,
Monika
I have the following code
var o = {}; o.tmp = function(c){ return { a : "model" b : function(...){ c.add(function(){ .... }); c.add(function(){ .... }); } } } o.tmp();
I understand that in this execution, the function "b" can not be executed. Using istanbul, I am getting following numbers : Statements : 55.56% ( 5/9 ) Branches : 100% ( 0/0 ) Functions : 25% ( 1/4 ) Lines : 55.56% ( 5/9 )
I don't understand how 55% of the function is executed. Most of the code is covered with the function declaration of "b". Also, what does (5/9) means? What are the 9 statements here? Thanks in advance, Monika