diff --git a/src/index.ts b/src/index.ts index f96bae70e..aabc29196 100644 --- a/src/index.ts +++ b/src/index.ts @@ -158,7 +158,6 @@ function traceIdFromRequest(request: Request): string { || crypto.randomUUID(); } -/* v8 ignore start */ function safeHash(input: string): string { let hash = 2166136261; for (let i = 0; i < input.length; i += 1) { @@ -168,6 +167,7 @@ function safeHash(input: string): string { return hash.toString(16).padStart(8, "0"); } +/* v8 ignore start */ function configuredRateLimit(env: Env): number { const limit = Number(env.NOEMA_RATE_LIMIT_PER_MINUTE ?? "60"); if (!Number.isFinite(limit) || limit <= 0) return 60; diff --git a/test/coverage-ignore-operational-helpers.test.ts b/test/coverage-ignore-operational-helpers.test.ts index 8e0faee4b..e76cf047d 100644 --- a/test/coverage-ignore-operational-helpers.test.ts +++ b/test/coverage-ignore-operational-helpers.test.ts @@ -10,6 +10,7 @@ describe("operational helper coverage exclusions", () => { "jsonResponse", "trustedTraceHeader", "traceIdFromRequest", + "safeHash", ])("keeps %s inside measured production coverage", (functionName) => { expect( ignoredRegions.some((region) => region.includes(`function ${functionName}`)),