From 5a741ca24a84556ac9d5b780b5b833d72aa5fa3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ari=20Perkki=C3=B6?= Date: Sat, 7 Oct 2023 11:09:16 +0300 Subject: [PATCH] feat!: enable `coverage.all` by default (#4265) --- docs/config/index.md | 2 +- packages/vitest/src/defaults.ts | 1 + test/coverage-test/testing-options.mjs | 1 + test/coverage-test/vitest.config.ts | 1 - test/workspaces/vitest.config.ts | 1 - 5 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/config/index.md b/docs/config/index.md index 310294949f64..78b221df456d 100644 --- a/docs/config/index.md +++ b/docs/config/index.md @@ -1042,7 +1042,7 @@ List of files excluded from coverage as glob patterns. #### coverage.all - **Type:** `boolean` -- **Default:** `false` +- **Default:** `true` (since Vitest `1.0.0`) - **Available for providers:** `'v8' | 'istanbul'` - **CLI:** `--coverage.all`, `--coverage.all=false` diff --git a/packages/vitest/src/defaults.ts b/packages/vitest/src/defaults.ts index ec5db4adef21..2e45b8932efa 100644 --- a/packages/vitest/src/defaults.ts +++ b/packages/vitest/src/defaults.ts @@ -32,6 +32,7 @@ const defaultCoverageExcludes = [ export const coverageConfigDefaults: ResolvedCoverageOptions = { provider: 'v8', enabled: false, + all: true, clean: true, cleanOnRerun: true, reportsDirectory: './coverage', diff --git a/test/coverage-test/testing-options.mjs b/test/coverage-test/testing-options.mjs index f86568c0720e..f40430fcfa78 100644 --- a/test/coverage-test/testing-options.mjs +++ b/test/coverage-test/testing-options.mjs @@ -44,6 +44,7 @@ for (const provider of ['v8', 'istanbul']) { coverage: { enabled: true, clean: true, + all: false, provider, ...testConfig.coverage, }, diff --git a/test/coverage-test/vitest.config.ts b/test/coverage-test/vitest.config.ts index 258ea5e8bf7b..93d04fbfacce 100644 --- a/test/coverage-test/vitest.config.ts +++ b/test/coverage-test/vitest.config.ts @@ -45,7 +45,6 @@ export default defineConfig({ customProviderModule: provider === 'custom' ? 'custom-provider' : undefined, include: ['src/**'], clean: true, - all: true, reporter: [ 'text', ['html'], diff --git a/test/workspaces/vitest.config.ts b/test/workspaces/vitest.config.ts index a817e50b78f3..5a9cf2e2004e 100644 --- a/test/workspaces/vitest.config.ts +++ b/test/workspaces/vitest.config.ts @@ -10,7 +10,6 @@ export default defineConfig({ test: { coverage: { enabled: true, - all: true, }, reporters: ['default', 'json'], outputFile: './results.json',