- I might be the only person who uses these, but I like to dig into coverage reports so I can see where we've got holes
- In Ghost the reports is huge and unweildy, and it's hard to see what coverage is like for components grouped by folders
- html-spa reporter fixes this, it makes a beautiful nested tree view, but you can also switch to flat
- it's so much more useful for working on coverage in an area of the codebase!
- Updating our config to have `--check-coverage` enforces that the coverage meets a certain level.
- The default is 95 I believe, but our coverage is lower.
- I've set the levels to our current levels, so any drop below these numbers will cause the build to fail.
- I've also set the reporters to be text, html and cobertura so we always have a mini report, the full HTML files to navigate and cobertura for CI
- Cleaned up CI so we don't use the cov:unit command as we're now using codecov
- This also means we can remove the cov:unit command which was weird to use because it uses the last test run, which can be confusing
There are some files we don't expect _unit_ tests for - they are e2e tested and tracking that is a different problem!
- express routes and wiring files
- this does not count middleware. Middleware functions should be fully unit tested
- previous API version files
- canary api endpoint configuration files
- this does not count api utils, valiation and serialisation which can be unit tested