All Projects → kwonoj → Jest Typescript Coverage

kwonoj / Jest Typescript Coverage

Licence: mit
Manual coverage remapping example for typescript code using jest

Programming Languages

javascript
184084 projects - #8 most used programming language

Jest-TypeScript-Coverage (DEPRECATED)

As jest / ts-jest supports coverage mapping, this repo's content is no longer valid.

Jest allows to use TypeScript based code with test cases by supporting scriptPreprocessor, but in case of code coverage it doesn't automatically remap coverage into original TypeScript source code but have to manually remap once jest populate coverage results.

This repo provides proof-of-concept snippet to manually remap code coverage using remap-istanbul jest and ts-jest preprocessor to run TypeScript based test cases.

Usage

npm test chains all necessary steps to generate coverage, once test completed it'll generate coverage_jest_raw for original coverage and coverage_remapped for remapped coverage. remap_coverage.js generates mutated code coverage allows remap to original build's source map then remap it via remap-istanbul.

Raw coverage

Remapped coverage

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].