douglasduteil / isparta

:skull: A code coverage tool for ES6 (babel/6to5)
Do What The F*ck You Want To Public License
642 stars 47 forks source link

Coverage is correct if function is a set as a dot property but not when set directly in an object literal #109

Open subtubes-io opened 8 years ago

subtubes-io commented 8 years ago

If my function is set as a 'dot' object property i.e.

var x = {};
x.myFn = function myFn() {//do something }

then the coverage report will be correct

if I set the property in the object literal it is wrong i.e.

var x = {myFn: function myFn() {//do something }};

the above example will not show up correctly in the coverage report

here is an image of my report

coverage report

I tested this quite a bit. Not sure why it is so. If need be I can create a sample repo for you to test out on.

I am using "isparta": "^4.0.0", in my package.json