Jest allows you to view test coverage when it runs.
But even if I only run tests for a specified file or files, the
--coverage output will include all files.
$ jest src/directoryToTest --coverage
If your app is large, this can generate a lot of output and be difficult to parse. If I only care about the coverage for files in
directoryToTest, I can filter the output of
$ jest src/directoryToTest --coverage --collectCoverageFrom="src/directoryToTest/**"