Jest - run coverage report for all files in the project?

Viewed 1681

I want to run a coverage report for all files in my code repo, including those that currently don't have any tests.

I'm using this command:

jest --coverage --collectCoverageFrom='src/features/**/*.{ts,tsx}

But there are other folders i want to cover. Is it not possible to "tell" Jest to look at all .ts and .tsx files across all folders, including nested folders?

1 Answers

The command you have should generate coverage report for all .ts and .jxs (was that meant to be jsx?) inside the the folders in src/features folder.

If you want to include other folders, for example everything inside /src then use

jest --coverage --collectCoverageFrom='src/**/*.{ts,jxs}'
Related