From 409cd5631b19aa75338fa51989d929b890713306 Mon Sep 17 00:00:00 2001 From: jonathangoulding Date: Fri, 20 Dec 2024 09:11:12 +0000 Subject: [PATCH] Highlight code with no tests but reported in coverage 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. --- .labrc.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.labrc.js b/.labrc.js index 121e42fed2..41e20cfda9 100644 --- a/.labrc.js +++ b/.labrc.js @@ -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'],