Files with tests in jest should be excluded from karma coverage report
The karma coverage report doesn't exclude files which have tests written in jest.
Files which are tested within jest should be excluded from the karma coverage report;
As we migrate away from karma we should prevent the framework from running against unnecessary files as this causes longer test times and can potentially result in unexpected errors.
An example of an unexpected error is outlined below;
The file analytics/code_analytics/components/app.vue
has a test file located in our jest test suite. The tests run perfectly and are super quick. Karma however picks this file up as not being tested and tries to include it in the untracked coverage report. While doing this, the file fails on import due to the babel plugin rewire error. As a result, time is spent investigating this and then an empty default export has to be included in the actions store file associated to analytics/code_analytics/components/app.vue
.
The additional effort of investigating a karma related error could have been avoided if karma detected that the file had a test in jest and simply skipped it.