Skip to content

Commit

Permalink
Highlight code with no tests but reported in coverage (#1579)
Browse files Browse the repository at this point in the history
As part of ongoing improvements we are trying to make sure all code has coverage (where deemed reasonable).

Some of our code may be tested indirectly and this helps cover parts of the codebase.

In this change we are highlighting that the:

- app server does not have/ or need a test
- check endpoints are for testing and is no production code so this is deemed to not need a test
- app plugins are inherently tested when testing with the server running with hapi lab

We can look to test these specifically at a later date.
  • Loading branch information
jonathangoulding authored Dec 23, 2024
1 parent 28d2b50 commit 40f4bf1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .labrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,17 @@
module.exports = {
verbose: true,
coverage: true,
'coverage-exclude': ['db/seeds'],
'coverage-exclude': [
'db/seeds',
'app/controllers/check.controller.js', // Test helper endpoints
// Most plugins are not tested directly (but are inherently tested by other tests loading the web server)
// The plugins below do no get 100% coverage, this comment is here to highlight this.
'app/plugins/airbrake.plugin.js',
'app/plugins/auth.plugin.js',
'app/plugins/hapi-pino.plugin.js',
'app/plugins/stop.plugin.js',
'app/plugins/views.plugin.js'
],
// lcov reporter required for SonarQube
reporter: ['console', 'html', 'lcov'],
output: ['stdout', 'coverage/coverage.html', 'coverage/lcov.info'],
Expand Down

0 comments on commit 40f4bf1

Please sign in to comment.