From 7cb6ecf02e5e483f55bc97ba10c5402eb82ebb27 Mon Sep 17 00:00:00 2001 From: AriPerkkio Date: Mon, 8 May 2023 15:04:22 +0300 Subject: [PATCH] feat!: remove usage of `c8` private APIs --- docs/config/index.md | 27 -- packages/coverage-c8/package.json | 16 +- packages/coverage-c8/src/provider.ts | 264 ++++++++++-------- packages/coverage-istanbul/package.json | 2 +- packages/coverage-istanbul/src/provider.ts | 64 +---- packages/vitest/src/types/coverage.ts | 21 -- packages/vitest/src/utils/coverage.ts | 54 ++++ pnpm-lock.yaml | 45 ++- .../__snapshots__/c8.report.test.ts.snap | 32 +-- .../test/configuration-options.test-d.ts | 3 - 10 files changed, 280 insertions(+), 248 deletions(-) diff --git a/docs/config/index.md b/docs/config/index.md index 37ba61e626e6..a22eac137ba2 100644 --- a/docs/config/index.md +++ b/docs/config/index.md @@ -843,33 +843,6 @@ See [istanbul documentation](https://github.com/istanbuljs/nyc#coverage-threshol Threshold for statements. See [istanbul documentation](https://github.com/istanbuljs/nyc#coverage-thresholds) for more information. -#### coverage.allowExternal - -- **Type:** `boolean` -- **Default:** `false` -- **Available for providers:** `'c8'` -- **CLI:** `--coverage.allowExternal`, `--coverage.allowExternal=false` - -Allow files from outside of your cwd. - -#### coverage.excludeNodeModules - -- **Type:** `boolean` -- **Default:** `true` -- **Available for providers:** `'c8'` -- **CLI:** `--coverage.excludeNodeModules`, `--coverage.excludeNodeModules=false` - -Exclude coverage under `/node_modules/`. - -#### coverage.src - -- **Type:** `string[]` -- **Default:** `process.cwd()` -- **Available for providers:** `'c8'` -- **CLI:** `--coverage.src=` - -Specifies the directories that are used when `--all` is enabled. - #### coverage.100 - **Type:** `boolean` diff --git a/packages/coverage-c8/package.json b/packages/coverage-c8/package.json index de436a790326..f5471550ada5 100644 --- a/packages/coverage-c8/package.json +++ b/packages/coverage-c8/package.json @@ -42,16 +42,26 @@ "prepublishOnly": "pnpm build" }, "peerDependencies": { - "vitest": ">=0.30.0 <1" + "vitest": ">=0.32.0 <1" }, "dependencies": { "@ampproject/remapping": "^2.2.1", - "c8": "^7.13.0", + "@bcoe/v8-coverage": "^0.2.3", + "istanbul-lib-coverage": "^3.2.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.1", + "istanbul-reports": "^3.1.5", "magic-string": "^0.30.0", "picocolors": "^1.0.0", - "std-env": "^3.3.2" + "std-env": "^3.3.2", + "test-exclude": "^6.0.0", + "v8-to-istanbul": "^9.1.0" }, "devDependencies": { + "@types/istanbul-lib-coverage": "^2.0.4", + "@types/istanbul-lib-report": "^3.0.0", + "@types/istanbul-lib-source-maps": "^4.0.1", + "@types/istanbul-reports": "^3.0.1", "pathe": "^1.1.0", "vite-node": "workspace:*", "vitest": "workspace:*" diff --git a/packages/coverage-c8/src/provider.ts b/packages/coverage-c8/src/provider.ts index 8fc0e8a2d388..95cdb1f26c85 100644 --- a/packages/coverage-c8/src/provider.ts +++ b/packages/coverage-c8/src/provider.ts @@ -1,26 +1,45 @@ import { existsSync, promises as fs } from 'node:fs' -import _url from 'node:url' import type { Profiler } from 'node:inspector' +import { fileURLToPath, pathToFileURL } from 'node:url' +import v8ToIstanbul from 'v8-to-istanbul' +import { mergeProcessCovs } from '@bcoe/v8-coverage' +import libReport from 'istanbul-lib-report' +import reports from 'istanbul-reports' +import type { CoverageMap } from 'istanbul-lib-coverage' +import libCoverage from 'istanbul-lib-coverage' +import libSourceMaps from 'istanbul-lib-source-maps' import MagicString from 'magic-string' import remapping from '@ampproject/remapping' -import { extname, resolve } from 'pathe' +import { normalize, resolve } from 'pathe' import c from 'picocolors' import { provider } from 'std-env' import type { EncodedSourceMap } from 'vite-node' -import { coverageConfigDefaults } from 'vitest/config' +import { coverageConfigDefaults, defaultExclude, defaultInclude } from 'vitest/config' import { BaseCoverageProvider } from 'vitest/coverage' import type { AfterSuiteRunMeta, CoverageC8Options, CoverageProvider, ReportContext, ResolvedCoverageOptions } from 'vitest' import type { Vitest } from 'vitest/node' -import type { Report } from 'c8' // @ts-expect-error missing types -import createReport from 'c8/lib/report.js' - -// @ts-expect-error missing types -import { checkCoverages } from 'c8/lib/commands/check-coverage.js' +import _TestExclude from 'test-exclude' + +interface TestExclude { + new(opts: { + cwd?: string | string[] + include?: string | string[] + exclude?: string | string[] + extension?: string | string[] + excludeNodeModules?: boolean + }): { + shouldInstrument(filePath: string): boolean + glob(cwd: string): Promise + } +} type Options = ResolvedCoverageOptions<'c8'> +// TODO: vite-node should export this +const WRAPPER_LENGTH = 185 + // Note that this needs to match the line ending as well const VITE_EXPORTS_LINE_PATTERN = /Object\.defineProperty\(__vite_ssr_exports__.*\n/g @@ -29,6 +48,7 @@ export class C8CoverageProvider extends BaseCoverageProvider implements Coverage ctx!: Vitest options!: Options + testExclude!: InstanceType coverages: Profiler.TakePreciseCoverageReturnType[] = [] initialize(ctx: Vitest) { @@ -38,10 +58,6 @@ export class C8CoverageProvider extends BaseCoverageProvider implements Coverage this.options = { ...coverageConfigDefaults, - // Provider specific defaults - excludeNodeModules: true, - allowExternal: false, - // User's options ...config, @@ -54,6 +70,14 @@ export class C8CoverageProvider extends BaseCoverageProvider implements Coverage branches: config['100'] ? 100 : config.branches, statements: config['100'] ? 100 : config.statements, } + + this.testExclude = new _TestExclude({ + cwd: ctx.config.root, + include: typeof this.options.include === 'undefined' ? undefined : [...this.options.include], + exclude: [...defaultExclude, ...defaultInclude, ...this.options.exclude], + excludeNodeModules: true, + extension: this.options.extension, + }) } resolveOptions() { @@ -75,122 +99,70 @@ export class C8CoverageProvider extends BaseCoverageProvider implements Coverage if (provider === 'stackblitz') this.ctx.logger.log(c.blue(' % ') + c.yellow('@vitest/coverage-c8 does not work on Stackblitz. Report will be empty.')) - const options: ConstructorParameters[0] = { - ...this.options, - all: this.options.all && allTestsRun, - reporter: this.options.reporter.map(([reporterName]) => reporterName), - reporterOptions: this.options.reporter.reduce((all, [name, options]) => ({ - ...all, - [name]: { - skipFull: this.options.skipFull, - projectRoot: this.ctx.config.root, - ...options, - }, - }), {}), - } - - const report = createReport(options) + const { result: scriptCoverages } = mergeProcessCovs(this.coverages.map(coverage => ({ + result: coverage.result.filter(result => this.testExclude.shouldInstrument(fileURLToPath(result.url))), + }))) - // Overwrite C8's loader as results are in memory instead of file system - report._loadReports = () => this.coverages + if (this.options.all && allTestsRun) { + const coveredFiles = Array.from(scriptCoverages.map(r => r.url)) + const untestedFiles = await this.getUntestedFiles(coveredFiles) - interface MapAndSource { map: EncodedSourceMap; source: string | undefined } - type SourceMapMeta = { url: string; filepath: string } & MapAndSource - - // add source maps - const sourceMapMeta: Record = {} - const extensions = Array.isArray(this.options.extension) ? this.options.extension : [this.options.extension] - - const fetchCache = this.ctx.projects.map(project => - Array.from(project.vitenode.fetchCache.entries()), - ).flat() - - const entries = Array - .from(fetchCache) - .filter(entry => report._shouldInstrument(entry[0])) - .map(([file, { result }]) => { - if (!result.map) - return null + scriptCoverages.push(...untestedFiles) + } - const filepath = file.split('?')[0] - const url = _url.pathToFileURL(filepath).href - const extension = extname(file) || extname(url) + const converted = await Promise.all(scriptCoverages.map(async ({ url, functions }) => { + const sources = await this.getSources(url) - return { - filepath, - url, - extension, - map: result.map, - source: result.code, - } - }) - .filter((entry) => { - if (!entry) - return false - - if (!extensions.includes(entry.extension)) - return false - - // Mappings and sourcesContent are needed for C8 to work - return ( - entry.map.mappings.length > 0 - && entry.map.sourcesContent - && entry.map.sourcesContent.length > 0 - && entry.map.sourcesContent[0] - && entry.map.sourcesContent[0].length > 0 - ) - }) as SourceMapMeta[] - - await Promise.all(entries.map(async ({ url, source, map, filepath }) => { - if (url in sourceMapMeta) - return - - let code: string | undefined - try { - code = (await fs.readFile(filepath)).toString() - } - catch { } + const converter = v8ToIstanbul(url, WRAPPER_LENGTH, sources) + await converter.load() - // Vite does not report full path in sourcemap sources - // so use an actual file path - const sources = [url] - - sourceMapMeta[url] = { - source, - map: { - sourcesContent: code ? [code] : undefined, - ...map, - sources, - }, - } + converter.applyCoverage(functions) + return converter.toIstanbul() })) - // This is a magic number. It corresponds to the amount of code - // that we add in packages/vite-node/src/client.ts:114 (vm.runInThisContext) - // TODO: Include our transformations in sourcemaps - const offset = 185 - - report._getSourceMap = (coverage: Profiler.ScriptCoverage) => { - const path = _url.pathToFileURL(coverage.url.split('?')[0]).href - const data = sourceMapMeta[path] - - if (!data) - return {} + const mergedCoverage = converted.reduce((coverage, previousCoverageMap) => { + const map = libCoverage.createCoverageMap(coverage) + map.merge(previousCoverageMap) + return map + }, libCoverage.createCoverageMap({})) + + const sourceMapStore = libSourceMaps.createSourceMapStore() + const coverageMap: CoverageMap = await sourceMapStore.transformCoverage(mergedCoverage) + + const context = libReport.createContext({ + dir: this.options.reportsDirectory, + coverageMap, + sourceFinder: sourceMapStore.sourceFinder, + watermarks: this.options.watermarks, + }) + + for (const reporter of this.options.reporter) { + reports.create(reporter[0], { + skipFull: this.options.skipFull, + projectRoot: this.ctx.config.root, + ...reporter[1], + }).execute(context) + } - return { - sourceMap: { - sourcemap: removeViteHelpersFromSourceMaps(data.source, data.map), + if (this.options.branches + || this.options.functions + || this.options.lines + || this.options.statements) { + this.checkThresholds({ + coverageMap, + thresholds: { + branches: this.options.branches, + functions: this.options.functions, + lines: this.options.lines, + statements: this.options.statements, }, - source: Array(offset).fill('.').join('') + data.source, - } + perFile: this.options.perFile, + }) } - await report.run() - await checkCoverages(options, report) - if (this.options.thresholdAutoUpdate && allTestsRun) { this.updateThresholds({ - coverageMap: await report.getCoverageMapFromAllCoverageFiles(), + coverageMap, thresholds: { branches: this.options.branches, functions: this.options.functions, @@ -202,6 +174,66 @@ export class C8CoverageProvider extends BaseCoverageProvider implements Coverage }) } } + + private async getUntestedFiles(testedFiles: string[]): Promise { + const includedFiles = await this.testExclude.glob(this.ctx.config.root) + const uncoveredFiles = includedFiles + .map(file => pathToFileURL(resolve(this.ctx.config.root, file))) + .filter(file => !testedFiles.includes(file.href)) + + return await Promise.all(uncoveredFiles.map(async (uncoveredFile) => { + const { source } = await this.getSources(uncoveredFile.href) + + return { + url: uncoveredFile.href, + scriptId: '0', + // Create a made up function to mark whole file as uncovered. Note that this does not exist in source maps. + functions: [{ + ranges: [{ + startOffset: 0, + // Wrapper length is required even for untested files istanbuljs/v8-to-istanbul#209 + endOffset: WRAPPER_LENGTH + source.length, + count: 0, + }], + isBlockCoverage: true, + // This is magical value that indicates an empty report: https://github.com/istanbuljs/v8-to-istanbul/blob/fca5e6a9e6ef38a9cdc3a178d5a6cf9ef82e6cab/lib/v8-to-istanbul.js#LL131C40-L131C40 + functionName: '(empty-report)', + }], + } + })) + } + + private async getSources(url: string): Promise<{ + source: string + originalSource?: string + sourceMap?: { sourcemap: EncodedSourceMap } + } | { source: string }> { + const filePath = normalize(fileURLToPath(url)) + const transformResult = this.ctx.projects + .map(project => project.vitenode.fetchCache.get(filePath)?.result) + .filter(Boolean) + .shift() + + const map = transformResult?.map + const code = transformResult?.code + const sourcesContent = map?.sourcesContent?.[0] || await fs.readFile(filePath, 'utf-8') + + if (!map) + return { source: code || sourcesContent } + + return { + originalSource: sourcesContent, + source: code || sourcesContent, + sourceMap: { + sourcemap: removeViteHelpersFromSourceMaps(code, { + ...map, + version: 3, + sources: [url], + sourcesContent: [sourcesContent], + }), + }, + } + } } /** @@ -225,5 +257,5 @@ function removeViteHelpersFromSourceMaps(source: string | undefined, map: Encode () => null, ) - return combinedMap + return combinedMap as EncodedSourceMap } diff --git a/packages/coverage-istanbul/package.json b/packages/coverage-istanbul/package.json index 01689118fc70..0d979fcc8b06 100644 --- a/packages/coverage-istanbul/package.json +++ b/packages/coverage-istanbul/package.json @@ -42,7 +42,7 @@ "prepublishOnly": "pnpm build" }, "peerDependencies": { - "vitest": ">=0.30.0 <1" + "vitest": ">=0.32.0 <1" }, "dependencies": { "istanbul-lib-coverage": "^3.2.0", diff --git a/packages/coverage-istanbul/src/provider.ts b/packages/coverage-istanbul/src/provider.ts index 12e490d202ee..84af13763de9 100644 --- a/packages/coverage-istanbul/src/provider.ts +++ b/packages/coverage-istanbul/src/provider.ts @@ -1,5 +1,5 @@ import { existsSync, promises as fs } from 'node:fs' -import { relative, resolve } from 'pathe' +import { resolve } from 'pathe' import type { AfterSuiteRunMeta, CoverageIstanbulOptions, CoverageProvider, ReportContext, ResolvedCoverageOptions, Vitest } from 'vitest' import { coverageConfigDefaults, defaultExclude, defaultInclude } from 'vitest/config' import { BaseCoverageProvider } from 'vitest/coverage' @@ -16,8 +16,6 @@ import { COVERAGE_STORE_KEY } from './constants' type Options = ResolvedCoverageOptions<'istanbul'> -type Threshold = 'lines' | 'functions' | 'statements' | 'branches' - interface TestExclude { new(opts: { cwd?: string | string[] @@ -146,11 +144,15 @@ export class IstanbulCoverageProvider extends BaseCoverageProvider implements Co || this.options.functions || this.options.lines || this.options.statements) { - this.checkThresholds(coverageMap, { - branches: this.options.branches, - functions: this.options.functions, - lines: this.options.lines, - statements: this.options.statements, + this.checkThresholds({ + coverageMap, + thresholds: { + branches: this.options.branches, + functions: this.options.functions, + lines: this.options.lines, + statements: this.options.statements, + }, + perFile: this.options.perFile, }) } @@ -169,52 +171,6 @@ export class IstanbulCoverageProvider extends BaseCoverageProvider implements Co } } - checkThresholds(coverageMap: CoverageMap, thresholds: Record) { - // Construct list of coverage summaries where thresholds are compared against - const summaries = this.options.perFile - ? coverageMap.files() - .map((file: string) => ({ - file, - summary: coverageMap.fileCoverageFor(file).toSummary(), - })) - : [{ - file: null, - summary: coverageMap.getCoverageSummary(), - }] - - // Check thresholds of each summary - for (const { summary, file } of summaries) { - for (const thresholdKey of ['lines', 'functions', 'statements', 'branches'] as const) { - const threshold = thresholds[thresholdKey] - - if (threshold !== undefined) { - const coverage = summary.data[thresholdKey].pct - - if (coverage < threshold) { - process.exitCode = 1 - - /* - * Generate error message based on perFile flag: - * - ERROR: Coverage for statements (33.33%) does not meet threshold (85%) for src/math.ts - * - ERROR: Coverage for statements (50%) does not meet global threshold (85%) - */ - let errorMessage = `ERROR: Coverage for ${thresholdKey} (${coverage}%) does not meet` - - if (!this.options.perFile) - errorMessage += ' global' - - errorMessage += ` threshold (${threshold}%)` - - if (this.options.perFile && file) - errorMessage += ` for ${relative('./', file).replace(/\\/g, '/')}` - - console.error(errorMessage) - } - } - } - } - } - async includeUntestedFiles(coverageMap: CoverageMap) { // Load, instrument and collect empty coverages from all files which // are not already in the coverage map diff --git a/packages/vitest/src/types/coverage.ts b/packages/vitest/src/types/coverage.ts index fe2d62562d18..dcdd1e1e1715 100644 --- a/packages/vitest/src/types/coverage.ts +++ b/packages/vitest/src/types/coverage.ts @@ -220,27 +220,6 @@ export interface CoverageIstanbulOptions extends BaseCoverageOptions { } export interface CoverageC8Options extends BaseCoverageOptions { - /** - * Allow files from outside of your cwd. - * - * @default false - */ - allowExternal?: boolean - - /** - * Exclude coverage under `/node_modules/` - * - * @default true - */ - excludeNodeModules?: boolean - - /** - * Specifies the directories that are used when `--all` is enabled. - * - * @default cwd - */ - src?: string[] - /** * Shortcut for `--check-coverage --lines 100 --functions 100 --branches 100 --statements 100` * diff --git a/packages/vitest/src/utils/coverage.ts b/packages/vitest/src/utils/coverage.ts index 20ff0a709ff1..7379243fd584 100644 --- a/packages/vitest/src/utils/coverage.ts +++ b/packages/vitest/src/utils/coverage.ts @@ -1,4 +1,5 @@ import { readFileSync, writeFileSync } from 'node:fs' +import { relative } from 'pathe' import type { CoverageMap } from 'istanbul-lib-coverage' import type { BaseCoverageOptions, ResolvedCoverageOptions } from '../types' @@ -61,6 +62,59 @@ export class BaseCoverageProvider { } } + /** + * Checked collected coverage against configured thresholds. Sets exit code to 1 when thresholds not reached. + */ + checkThresholds({ coverageMap, thresholds, perFile }: { + coverageMap: CoverageMap + thresholds: Record + perFile?: boolean + }) { + // Construct list of coverage summaries where thresholds are compared against + const summaries = perFile + ? coverageMap.files() + .map((file: string) => ({ + file, + summary: coverageMap.fileCoverageFor(file).toSummary(), + })) + : [{ + file: null, + summary: coverageMap.getCoverageSummary(), + }] + + // Check thresholds of each summary + for (const { summary, file } of summaries) { + for (const thresholdKey of ['lines', 'functions', 'statements', 'branches'] as const) { + const threshold = thresholds[thresholdKey] + + if (threshold !== undefined) { + const coverage = summary.data[thresholdKey].pct + + if (coverage < threshold) { + process.exitCode = 1 + + /* + * Generate error message based on perFile flag: + * - ERROR: Coverage for statements (33.33%) does not meet threshold (85%) for src/math.ts + * - ERROR: Coverage for statements (50%) does not meet global threshold (85%) + */ + let errorMessage = `ERROR: Coverage for ${thresholdKey} (${coverage}%) does not meet` + + if (!perFile) + errorMessage += ' global' + + errorMessage += ` threshold (${threshold}%)` + + if (perFile && file) + errorMessage += ` for ${relative('./', file).replace(/\\/g, '/')}` + + console.error(errorMessage) + } + } + } + } + } + /** * Resolve reporters from various configuration options */ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c19f8ea824d3..4f92b76b94f0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -888,9 +888,21 @@ importers: '@ampproject/remapping': specifier: ^2.2.1 version: 2.2.1 - c8: - specifier: ^7.13.0 - version: 7.13.0 + '@bcoe/v8-coverage': + specifier: ^0.2.3 + version: 0.2.3 + istanbul-lib-coverage: + specifier: ^3.2.0 + version: 3.2.0 + istanbul-lib-report: + specifier: ^3.0.0 + version: 3.0.0 + istanbul-lib-source-maps: + specifier: ^4.0.1 + version: 4.0.1 + istanbul-reports: + specifier: ^3.1.5 + version: 3.1.5 magic-string: specifier: ^0.30.0 version: 0.30.0 @@ -900,7 +912,25 @@ importers: std-env: specifier: ^3.3.2 version: 3.3.2 + test-exclude: + specifier: ^6.0.0 + version: 6.0.0 + v8-to-istanbul: + specifier: ^9.1.0 + version: 9.1.0 devDependencies: + '@types/istanbul-lib-coverage': + specifier: ^2.0.4 + version: 2.0.4 + '@types/istanbul-lib-report': + specifier: ^3.0.0 + version: 3.0.0 + '@types/istanbul-lib-source-maps': + specifier: ^4.0.1 + version: 4.0.1 + '@types/istanbul-reports': + specifier: ^3.0.1 + version: 3.0.1 pathe: specifier: ^1.1.0 version: 1.1.0 @@ -11396,7 +11426,7 @@ packages: istanbul-reports: 3.1.5 rimraf: 3.0.2 test-exclude: 6.0.0 - v8-to-istanbul: 9.0.1 + v8-to-istanbul: 9.1.0 yargs: 16.2.0 yargs-parser: 20.2.9 dev: true @@ -11415,9 +11445,10 @@ packages: istanbul-reports: 3.1.5 rimraf: 3.0.2 test-exclude: 6.0.0 - v8-to-istanbul: 9.0.1 + v8-to-istanbul: 9.1.0 yargs: 16.2.0 yargs-parser: 20.2.9 + dev: true /cac@6.7.14: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} @@ -24011,8 +24042,8 @@ packages: source-map: 0.7.4 dev: true - /v8-to-istanbul@9.0.1: - resolution: {integrity: sha512-74Y4LqY74kLE6IFyIjPtkSTWzUZmj8tdHT9Ii/26dvQ6K9Dl2NbEfj0XgU2sHCtKgt5VupqhlO/5aWuqS+IY1w==} + /v8-to-istanbul@9.1.0: + resolution: {integrity: sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==} engines: {node: '>=10.12.0'} dependencies: '@jridgewell/trace-mapping': 0.3.18 diff --git a/test/coverage-test/coverage-report-tests/__snapshots__/c8.report.test.ts.snap b/test/coverage-test/coverage-report-tests/__snapshots__/c8.report.test.ts.snap index e55e5fbacbf3..5abdfff8b463 100644 --- a/test/coverage-test/coverage-report-tests/__snapshots__/c8.report.test.ts.snap +++ b/test/coverage-test/coverage-report-tests/__snapshots__/c8.report.test.ts.snap @@ -1264,7 +1264,7 @@ exports[`c8 json report 1`] = ` "line": 13, }, "start": { - "column": 17, + "column": 0, "line": 11, }, }, @@ -1275,7 +1275,7 @@ exports[`c8 json report 1`] = ` "line": 13, }, "start": { - "column": 17, + "column": 0, "line": 11, }, }, @@ -1350,7 +1350,7 @@ exports[`c8 json report 1`] = ` "line": 13, }, "start": { - "column": 17, + "column": 0, "line": 11, }, }, @@ -1361,7 +1361,7 @@ exports[`c8 json report 1`] = ` "line": 13, }, "start": { - "column": 17, + "column": 0, "line": 11, }, }, @@ -1882,7 +1882,7 @@ exports[`c8 json report 1`] = ` "line": 8, }, "start": { - "column": 49, + "column": 7, "line": 1, }, }, @@ -1893,7 +1893,7 @@ exports[`c8 json report 1`] = ` "line": 8, }, "start": { - "column": 49, + "column": 7, "line": 1, }, }, @@ -1912,7 +1912,7 @@ exports[`c8 json report 1`] = ` "line": 8, }, "start": { - "column": 49, + "column": 7, "line": 1, }, }, @@ -1923,7 +1923,7 @@ exports[`c8 json report 1`] = ` "line": 8, }, "start": { - "column": 49, + "column": 7, "line": 1, }, }, @@ -2040,7 +2040,7 @@ exports[`c8 json report 1`] = ` "line": 3, }, "start": { - "column": 31, + "column": 7, "line": 1, }, }, @@ -2051,7 +2051,7 @@ exports[`c8 json report 1`] = ` "line": 3, }, "start": { - "column": 31, + "column": 7, "line": 1, }, }, @@ -2070,7 +2070,7 @@ exports[`c8 json report 1`] = ` "line": 3, }, "start": { - "column": 31, + "column": 7, "line": 1, }, }, @@ -2081,7 +2081,7 @@ exports[`c8 json report 1`] = ` "line": 3, }, "start": { - "column": 31, + "column": 7, "line": 1, }, }, @@ -2732,7 +2732,7 @@ exports[`c8 json report 1`] = ` "line": 3, }, "start": { - "column": 42, + "column": 7, "line": 1, }, }, @@ -2743,7 +2743,7 @@ exports[`c8 json report 1`] = ` "line": 3, }, "start": { - "column": 42, + "column": 7, "line": 1, }, }, @@ -2845,7 +2845,7 @@ exports[`c8 json report 1`] = ` "line": 3, }, "start": { - "column": 42, + "column": 7, "line": 1, }, }, @@ -2856,7 +2856,7 @@ exports[`c8 json report 1`] = ` "line": 3, }, "start": { - "column": 42, + "column": 7, "line": 1, }, }, diff --git a/test/coverage-test/test/configuration-options.test-d.ts b/test/coverage-test/test/configuration-options.test-d.ts index 8b9b0de67c99..5c207c587911 100644 --- a/test/coverage-test/test/configuration-options.test-d.ts +++ b/test/coverage-test/test/configuration-options.test-d.ts @@ -45,10 +45,7 @@ test('provider options, generic', () => { test('provider specific options, c8', () => { assertType({ provider: 'c8', - src: ['string'], 100: true, - excludeNodeModules: false, - allowExternal: true, }) assertType({