Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
test(web): include untested sources in coverage (#44254)
Stephen Zhoua5a937a01d11
diff --git a/web/docs/test.md b/web/docs/test.mdindex d7fd199479b..8461915fcdb 100644--- a/web/docs/test.md+++ b/web/docs/test.md@@ -21,6 +21,10 @@ Decide whether a regression needs lasting automated coverage before choosing itsCoverage is a diagnostic signal, not a quality target. This guide defines no required percentage and reviewers should not request tests solely to increase coverage. Use a report to find suspicious gaps, then decide whether each gap represents a product risk worth protecting.+The unit coverage report includes authored JavaScript and TypeScript throughout `web/`, including runtime entry points, scripts, plugins, and files that no test imports. It excludes test infrastructure, stories, declarations, generated sources, tool configuration, build output, and vendored static code. TypeScript modules containing only erased types have no executable statements and are not meaningful zero-coverage findings. Local coverage runs also produce an HTML report at `coverage/index.html`.++Run the full `unit` project before using coverage to identify untested modules. A focused run measures only the selected tests. Zero unit coverage does not imply that Browser Mode or E2E never exercises the file; those suites do not contribute to this report. Anonymous VM scripts and subprocesses can also execute code without attributing coverage to its source file. Check existing tests and separate product modules from development tooling when prioritizing the findings.+## Choose the Right BoundaryUse the smallest boundary that includes the behavior owner and proves the product contract without coupling the test to implementation:diff --git a/web/vite.config.ts b/web/vite.config.tsindex 5eb2c974972..e97f1f4c8c9 100644--- a/web/vite.config.ts+++ b/web/vite.config.ts@@ -97,8 +97,29 @@ export default defineConfig(({ command, mode, isPreview }) => {attachmentsDir: './.vitest-browser/attachments',coverage: {provider: 'v8',- reporter: isCI ? ['json', 'json-summary'] : ['text', 'json', 'json-summary'],- exclude: ['**/__mocks__/**'],+ // Include authored sources even when no test imports them.+ include: ['**/*.{js,jsx,ts,tsx,mjs,mts,cjs,cts}'],+ reporter: isCI ? ['json', 'json-summary'] : ['text', 'html', 'json', 'json-summary'],+ exclude: [+ // Test infrastructure and examples do not belong in the source denominator.+ '**/{__tests__,__mocks__}/**',+ '**/*.{spec,test,stories}.*',+ 'test/**',+ 'vitest*.setup.ts',+ 'plugins/tsslint/test-utils.ts',+ // Declarations, generated sources, tool configuration, and build output.+ '**/*.d.{ts,mts,cts}',+ '**/*.{generated,gen}.*',+ 'types/doc-paths.ts',+ '*.config.*',+ 'scripts/a11y/oxlint.config.ts',+ '.*/**',+ '**/dist/**',+ '{coverage,build,out,storybook-static}/**',+ // Keep public/embed.js, but omit its minified copy and vendored workers/editor.+ 'public/**/*.min.{js,mjs}',+ 'public/vs/**',+ ],},projects: [{