Skip to content

Commit

Permalink
chore: add c8 flag for 100 % code coverage (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
dancastillo authored Sep 4, 2024
1 parent ae67f81 commit 1340981
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 1340981

Please sign in to comment.