| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 6ec36f5 commit 956ccaa
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -75,8 +75,7 @@ | |||
| 75 | 75 | }, | |
| 76 | 76 | "coverage": { | |
| 77 | 77 | "type": "boolean", | |
| 78 | - "description": "Enables coverage reporting for tests.", | ||
| 79 | - "default": false | ||
| 78 | + "description": "Enables coverage reporting for tests. If not specified, the coverage configuration from a runner configuration file will be used if present. Otherwise, coverage is disabled by default." | ||
| 80 | 79 | }, | |
| 81 | 80 | "coverageInclude": { | |
| 82 | 81 | "type": "array", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -92,6 +92,31 @@ describeBuilder(execute, UNIT_TEST_BUILDER_INFO, (harness) => { | |||
| 92 | 92 | harness.expectFile('coverage/test/coverage-final.json').toExist(); | |
| 93 | 93 | }); | |
| 94 | 94 | ||
| 95 | + it('should enable coverage when set in runnerConfig file without builder option', async () => { | ||
| 96 | + harness.useTarget('test', { | ||
| 97 | + ...BASE_OPTIONS, | ||
| 98 | + runnerConfig: 'vitest.config.ts', | ||
| 99 | + }); | ||
| 100 | + | ||
| 101 | + harness.writeFile( | ||
| 102 | + 'vitest.config.ts', | ||
| 103 | + ` | ||
| 104 | + import { defineConfig } from 'vitest/config'; | ||
| 105 | + export default defineConfig({ | ||
| 106 | + test: { | ||
| 107 | + coverage: { | ||
| 108 | + enabled: true, | ||
| 109 | + }, | ||
| 110 | + }, | ||
| 111 | + }); | ||
| 112 | + `, | ||
| 113 | + ); | ||
| 114 | + | ||
| 115 | + const { result } = await harness.executeOnce(); | ||
| 116 | + expect(result?.success).toBeTrue(); | ||
| 117 | + harness.expectFile('coverage/test/coverage-final.json').toExist(); | ||
| 118 | + }); | ||
| 119 | + | ||
| 95 | 120 | it('should exclude test files based on runnerConfig file', async () => { | |
| 96 | 121 | harness.useTarget('test', { | |
| 97 | 122 | ...BASE_OPTIONS, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments