From b5dacf23f02c7bec42c7197b260e70f778e9040f Mon Sep 17 00:00:00 2001 From: "dan.castillo" Date: Wed, 4 Sep 2024 19:10:36 -0400 Subject: [PATCH] chore: add c8 flag for 100 % code coverage --- index.js | 10 ++++------ package.json | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index 89c93d8..ce99e5d 100644 --- a/index.js +++ b/index.js @@ -34,9 +34,8 @@ async function fastifyHelmet (fastify, options) { }) fastify.addHook('onRequest', async (request, reply) => { - /* istanbul ignore next */ - const { helmet: routeOptions } = request.routeOptions?.config || - request.routeConfig + /* c8 ignore next */ + const { helmet: routeOptions } = request.routeOptions?.config || request.routeConfig if (routeOptions !== undefined) { const { enableCSPNonces: enableRouteCSPNonces, skipRoute, ...helmetRouteConfiguration } = routeOptions @@ -52,9 +51,8 @@ async function fastifyHelmet (fastify, options) { }) fastify.addHook('onRequest', (request, reply, next) => { - /* istanbul ignore next */ - const { helmet: routeOptions } = request.routeOptions?.config || - request.routeConfig + /* c8 ignore next */ + const { helmet: routeOptions } = request.routeOptions?.config || request.routeConfig if (routeOptions !== undefined) { const { enableCSPNonces: enableRouteCSPNonces, skipRoute, ...helmetRouteConfiguration } = routeOptions diff --git a/package.json b/package.json index 65dc251..9481eff 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "lint:fix": "standard --fix | snazzy", "test": "npm run lint && npm run unit && npm run typescript", "test:ci": "npm run lint && npm run coverage && npm run typescript", - "unit": "c8 node --test", + "unit": "c8 --100 node --test", "unit:report": "npm run unit -- --coverage-report=html", "unit:verbose": "npm run unit -- -Rspec", "typescript": "tsd"