Source maps support for Istanbul code coverage toolkit, enabling accurate coverage reporting for transpiled JavaScript code
Overall
score
98%
A utility for transforming Istanbul coverage data that has embedded source maps, converting coverage locations from transpiled code back to original source files.
inputSourceMap property, the transformation returns a coverage map that references the original source file path and original source locations @testsourcesContent, the transformation caches the original source content for later retrieval @testinputSourceMap but with a registered source map via registerMap, the transformation uses the registered map to transform coverage @test@generates
/**
* Creates a source map store for managing source maps and transforming coverage data.
*
* @param {Object} opts - Optional configuration
* @param {string} opts.baseDir - Base directory for resolving relative paths (defaults to process.cwd())
* @param {boolean} opts.verbose - Enable verbose logging
* @returns {MapStore} MapStore instance
*/
function createSourceMapStore(opts) {
// IMPLEMENTATION HERE
}
/**
* MapStore - manages source maps and transforms coverage data
*
* Methods:
* - registerMap(filePath, sourceMap): Registers a source map object for a transformed file
* - transformCoverage(coverageMap): Asynchronously transforms coverage data using embedded or registered source maps
* Returns a Promise that resolves to a transformed CoverageMap with original source locations
*/
module.exports = {
createSourceMapStore
};Provides source map support for Istanbul code coverage transformation, including MapStore creation, source map registration, and coverage transformation capabilities.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-istanbul-lib-source-mapsdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10