Created by: macktrix
Adding collectCoverageFrom option to the config to cover files that have no tests. This is set to look for any file under the src/
directory.
Below is the coverage report prior to the change:
And here is the coverage after the change with the same tests:
It's worth noting this can currently be achieved by passing the arguments through
npm test -- --coverage --collectCoverageFrom='src/**/*.{js,jsx}'
.
This change would make this the default behaviour. If a different path is required then passing it as an argument overrides the default.
For example if I only cared about the actions folder I could run:
npm test -- --coverage --collectCoverageFrom='src/actions/*.{js,jsx}'
A similar PR was already submitted #905 but the author hasn't responded in a while. This is also without the ignore path as I feel its unnecessary.