I want to convert istanbul coverage report file fetched from client in JSON format to html format. Currently I'm using remap-istanbul for this but actually that particular that particular tool is designed to remap coverage data for code which was originally written in different languages (like typescript).
So I guess whether there's more convenient way to do the same
Use
istanbul report htmlto convert existing coverage data from JSON to HTML:By default, the above looks in the current directory (and its subdirectories) for any file starting with "coverage" and ending with ".json", and outputs the HTML reports to the
./coverage/directory.To convert a specific file to a specific directory:
Another way to only read coverage reports from a specific directory (e.g. all JSON files in
path/to) is as follows, using the--rootoption:Use
istanbul help reportto see more options (the following is generated with istanbul 0.4.5):The value of
--inputis a glob pattern. For more documentation on glob patterns, see the documentation at theglobpackage on NPM.