From 257ba2f24bb5a221ff73d64c647bea2ffc2c4dd6 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 7 Sep 2026 23:40:58 +0200 Subject: [PATCH] test(client): keep benchmarks out of the coverage report The client's coverage `include` is `src/**/*.{ts,tsx}` and its `exclude` names only specs and declarations, so `formatters.bench.ts` counts as production source. Benchmarks run under `vitest bench`, which the test run never invokes, so it reports as wholly uncovered and has been depressing the client figure for as long as it has existed. It went unnoticed because nothing had touched the file since it was added. Moving it onto the vitest 5 bench API put it in a diff, and codecov measured the patch at 0.00% against an 80% target. It is the only benchmark in the repository today; the glob covers the rest. Co-Authored-By: Claude Opus 5 (1M context) --- apps/client/vite.config.mts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/client/vite.config.mts b/apps/client/vite.config.mts index bf7b237c7a..0ec0238dd5 100644 --- a/apps/client/vite.config.mts +++ b/apps/client/vite.config.mts @@ -151,7 +151,9 @@ export default defineConfig(() => ({ // every path is unambiguous. reporter: ["text", "html", ["lcov", { projectRoot: join(import.meta.dirname, "../..") }]], include: ["src/**/*.{ts,tsx}"], - exclude: ["**/*.{test,spec}.{ts,mts,cts,tsx,js,jsx}", "**/*.d.ts"] + // Benchmarks are measured by `vitest bench`, which the test run never invokes, so a + // `*.bench.ts` left in scope reports as wholly uncovered source. + exclude: ["**/*.{test,spec}.{ts,mts,cts,tsx,js,jsx}", "**/*.bench.{ts,mts,cts,tsx}", "**/*.d.ts"] }, }, commonjsOptions: {