From 3c963bb1d9a12a3cf5e24505e047a2dec59a2321 Mon Sep 17 00:00:00 2001 From: Jack Date: Mon, 19 Oct 2026 00:39:57 +0800 Subject: [PATCH] Scope coverage to our own sources v8 coverage had no include, so it walked the entire project root. With the read-only reference_code checkout present that pulled 572 of 1031 entries into the report and reported 23.94% for "All files" - a number describing the reference, not this project. Restricting it to packages/*/src puts the figure at 59.71%. Nothing failed on this before because there are no coverage thresholds, but the report was misleading anyone reading it. --- vitest.config.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vitest.config.ts b/vitest.config.ts index 0868870..eefa362 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -13,5 +13,13 @@ export default defineConfig({ test: { include: ['tests/**/*.test.ts'], setupFiles: ['tests/setup.ts'], + coverage: { + // Without an explicit include, v8 coverage walks the whole project root. + // While the read-only reference_code/ checkout was present that pulled in + // ~570 of its files and diluted every percentage below. + provider: 'v8', + include: ['packages/*/src/**'], + exclude: ['**/vendor/**', '**/*.d.ts'], + }, }, })