The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Track project code coverage with Jest

Track project code coverage with Jest

3:07
Jest comes pre-packaged with the ability to track code coverage for the modules you're testing, but it takes a little extra work to make it track untested files as well. Let's look at what Jest can do for you, what you have to do yourself, and how to setup code coverage thresholds so you can work to improving the code coverage numbers for your projects.
Watch this lesson now
Avatar
egghead.io

Jest comes pre-packaged with the ability to track code coverage for the modules you're testing, but it takes a little extra work to make it track untested files as well. Let's look at what Jest can do for you, what you have to do yourself, and how to setup code coverage thresholds so you can work to improving the code coverage numbers for your projects.

Avatar
Edouard

Hi thanks for this short presentation of coverage with Jest.
I have implemented Jest in my Typescript project. However, even with a preprocessor set to compile *.ts files, coverage seems to work only with *.js files.

Any idea or resources to explain how could it work with a transpiler?

In reply to egghead.io
Avatar
Kent C.

I haven't tried using TypeScript with Jest before, but I'll bet moduleFileExtensions is what you're looking for.

In reply to Edouard
HEY, QUICK QUESTION!
Joel's Head
Why are we asking?