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.
Of course you need to have a linux based system to get this up and running.
If so and you don't mind the global dependencies installed via sudo, just run make deps deps-global cover check-cover and see it failing. Or just use a VM for this.
Here is the stack trace
checking coverage...
--------------------------
[ '0', '1', '2', '3', '4', '5' ]
--------------------------
/usr/lib/node_modules/babel-istanbul/lib/object-utils.js:241
Object.keys(second.s).forEach(function (k) {
^
TypeError: Cannot convert undefined or null to object
at Function.keys (native)
at Object.mergeFileCoverage (/usr/lib/node_modules/babel-istanbul/lib/object-utils.js:241:16)
at /usr/lib/node_modules/babel-istanbul/lib/collector.js:71:44
at Array.forEach (native)
at Object.Collector.add (/usr/lib/node_modules/babel-istanbul/lib/collector.js:68:31)
at /usr/lib/node_modules/babel-istanbul/lib/command/check-coverage.js:125:27
at Array.forEach (native)
at /usr/lib/node_modules/babel-istanbul/lib/command/check-coverage.js:123:19
at /usr/lib/node_modules/babel-istanbul/lib/util/file-matcher.js:39:20
at Object.next (/usr/lib/node_modules/babel-istanbul/node_modules/fileset/lib/fileset.js:43:14)
node_modules/esmake/Makefile.software.in:79: recipe for target 'check-cover' failed
As you can see above between the ------, the actual keys of second are different from the ones expected by object-utils, that is, neither second.s nor second.f nor second.b are defined.
I have a project that will generate a TypeError in lib/object-utils.js when checking the coverage status.
See https://github.com/coldrye-es/ypo-parser. In order to build, first clone and then run npm install esmake in the project's folder.
Of course you need to have a linux based system to get this up and running. If so and you don't mind the global dependencies installed via sudo, just run
make deps deps-global cover check-cover
and see it failing. Or just use a VM for this.Here is the stack trace
As you can see above between the
------
, the actual keys ofsecond
are different from the ones expected by object-utils, that is, neithersecond.s
norsecond.f
norsecond.b
are defined.Here is my
.istanbul.yml
config