Skip to content
This repository has been archived by the owner on Nov 26, 2017. It is now read-only.

kwonoj/jest-typescript-coverage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Manual coverage remapping example for typescript code using jest

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published