Package Exports
- atlas-coverage
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (atlas-coverage) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
atlas-coverage-js
A node module to run atlas-coverage from node.
Purpose
This tool allows you to take code coverage data on minified js from puppeteer and convert it into code coverage on the original source files by parsing and traversing the source map files.
How to Use
The implementation is pretty simple. This wrapper does two things:
- Optionally downloads a copy of the atlas-coverage binary for you machine (architecture/platform)
- Provides a javascript wrapper around the cli arguments.
Initializing
You first have to initialize the atlas-coverage runner by telling it where to store and look for the platform specific binaries. That's the cache path.
let cache_path = path.resolve(__dirname, '../tools');
require("atlas-coverage").initialize({cachePath}) // atlas-coverage will manage it's cached files in ../tools/atlas-binUsing
You'll need to generate a settings file for atlas coverage, once you've done that, you can call it thusly:
atlas.run({
configPath: configPath, // Where to find the configuration file
outputPath: outputPath, // Where to write the output xml file
inputFolder: inputPath, // Where to look for the puppeteer coverage .json files (not a recursive search)
})Example project
atlas-coverage-js-demo is an example project that shows how a demo angular project was converted to run e2e tests against the minified files, and how atlas-coverage was integrated to get code coverage data out of it.