Source maps support for Istanbul code coverage toolkit, enabling accurate coverage reporting for transpiled JavaScript code
Overall
score
98%
Build a simple code coverage reporter that handles transpiled JavaScript files using source maps to report coverage on the original source code.
Your task is to implement a coverage reporting utility that:
Your implementation should accept:
Return a summary object containing:
Create a module that exports a function generateCoverageReport(coverageData, sourceMaps) that:
The function should handle cases where source maps might not be available for some files (skip those files gracefully).
@generates
/**
* Generate a coverage report by transforming transpiled coverage data back to original sources
* @param {Object} coverageData - Coverage data object for transpiled files
* @param {Object} sourceMaps - Map of file paths to source map URLs or objects
* @returns {Promise<Object>} Summary object with originalFileCount, originalFiles array, and success boolean
*/
async function generateCoverageReport(coverageData, sourceMaps) {
// Implementation here
}
module.exports = { generateCoverageReport };Provides source map support for transforming coverage data from transpiled code to original source locations.
@satisfied-by
Provides coverage data structures and utilities for working with code coverage information.
@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