gotwarlost / istanbul

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.
Other
8.7k stars 787 forks source link

How to get "coverage JSON objects" from instrumented code #760

Open SCLeoX opened 7 years ago

SCLeoX commented 7 years ago

I am trying to use Istanbul API. Now I just got instrumented code.

image

I tried to eval it but it returned undefined. So what should I do to get the "coverage JSON objects" which I can feed into the collector.