Transform an LCOV file using sourcemaps.
This package will look for sourcemap files under the given source directory.
The lcov file lists files that are covered. This package will look for
sourcemaps with the name <file>.map
.
- Run tests against transformed, concat'ed, etc. dist file
- Get code coverage per source file
Install with npm
npm install --save-dev lcov-autosourcemap
var lcovSourcemap = require("lcov-sourcemap");
lcovSourcemap("./coverage/lcov-raw.info", "./src").then(function (lcov) {
// lcov string
});
lcovSourcemap.writeLcov("./coverage/lcov-raw.info", "./src", "./coverage/lcov.info").then(function () {
// Done!
});
- lcovFilePath (String): Lcov file.
- sourceDir (String): Source directory to look for files (checks for existence).
- return (Promise): Promise containing Lcov string
- Arguments similar to
lcovSourceMap
- outputLcovFilePath (String): Output lcov file path.
- return (Promise): Resolves when write is complete