[READ-ONLY] Mirror of https://github.com/vitest-dev/vitest. Next generation testing framework powered by Vite. vitest.dev
test testing-tools vite
12

Configure Feed

Select the types of activity you want to include in your feed.

test(coverage): refactor testing structure (#5837)

authored by

Ari Perkkiö and committed by
GitHub
(Jun 24, 2024, 10:31 AM +0300) 19e9babf 7fd341c1

+4347 -10726
+4 -1
pnpm-lock.yaml
··· 1229 1229 istanbul-lib-report: 1230 1230 specifier: ^3.0.1 1231 1231 version: 3.0.1 1232 + magic-string: 1233 + specifier: ^0.30.10 1234 + version: 0.30.10 1232 1235 magicast: 1233 1236 specifier: ^0.3.3 1234 1237 version: 0.3.3 ··· 4989 4992 devalue: 4.3.2 4990 4993 esm-env: 1.0.0 4991 4994 kleur: 4.1.5 4992 - magic-string: 0.30.5 4995 + magic-string: 0.30.10 4993 4996 mime: 3.0.0 4994 4997 sade: 1.8.1 4995 4998 set-cookie-parser: 2.6.0
+1
tsconfig.check.json
··· 16 16 "./bench/**", 17 17 "./test/typescript/**", 18 18 "./test/browser/**", 19 + "**/coverage/fixtures/**", 19 20 "./test/watch/fixtures/**" 20 21 ] 21 22 }
-1
test/coverage-test/.gitignore
··· 1 - src/dynamic-file.ignore.*
-113
test/coverage-test/custom-provider.ts
··· 1 - import { existsSync, mkdirSync, rmSync, writeFileSync } from 'node:fs' 2 - import type { AfterSuiteRunMeta, CoverageProvider, CoverageProviderModule, ReportContext, ResolvedCoverageOptions, Vitest } from 'vitest' 3 - 4 - import { normalizeFilename } from './coverage-report-tests/utils' 5 - 6 - const CustomCoverageProviderModule: CoverageProviderModule = { 7 - getProvider(): CoverageProvider { 8 - return new CustomCoverageProvider() 9 - }, 10 - 11 - takeCoverage() { 12 - // @ts-expect-error -- untyped 13 - globalThis.CUSTOM_PROVIDER_TAKE_COVERAGE = true 14 - 15 - // @ts-expect-error -- untyped 16 - if (!globalThis.CUSTOM_PROVIDER_START_COVERAGE) { 17 - throw new Error('takeCoverage was called before startCoverage!') 18 - } 19 - 20 - return { customCoverage: 'Coverage report passed from workers to main thread' } 21 - }, 22 - 23 - startCoverage() { 24 - // @ts-expect-error -- untyped 25 - globalThis.CUSTOM_PROVIDER_START_COVERAGE = true 26 - }, 27 - 28 - stopCoverage() { 29 - // @ts-expect-error -- untyped 30 - if (!globalThis.CUSTOM_PROVIDER_START_COVERAGE) { 31 - throw new Error('stopCoverage was called before startCoverage!') 32 - } 33 - 34 - // @ts-expect-error -- untyped 35 - if (!globalThis.CUSTOM_PROVIDER_TAKE_COVERAGE) { 36 - throw new Error('stopCoverage was called before takeCoverage!') 37 - } 38 - }, 39 - } 40 - 41 - /** 42 - * Provider that simply keeps track of the functions that were called 43 - */ 44 - class CustomCoverageProvider implements CoverageProvider { 45 - name = 'custom-coverage-provider' 46 - 47 - options!: ResolvedCoverageOptions 48 - calls: Set<string> = new Set() 49 - coverageReports: Set<string> = new Set() 50 - transformedFiles: Set<string> = new Set() 51 - 52 - initialize(ctx: Vitest) { 53 - this.options = ctx.config.coverage 54 - 55 - this.calls.add(`initialized ${ctx ? 'with' : 'without'} context`) 56 - } 57 - 58 - clean(force?: boolean) { 59 - this.calls.add(`clean ${force ? 'with' : 'without'} force`) 60 - } 61 - 62 - onAfterSuiteRun(meta: AfterSuiteRunMeta) { 63 - // Do not include coverage info here, as order of tests is not guaranteed 64 - this.calls.add('onAfterSuiteRun') 65 - 66 - // Keep coverage info separate from calls and ignore its order 67 - this.coverageReports.add(JSON.stringify({ 68 - ...meta, 69 - 70 - // Project name keeps changing so let's simply check that its present 71 - projectName: meta.projectName && typeof meta.projectName === 'string', 72 - })) 73 - } 74 - 75 - generateCoverage(_reportContext: ReportContext) { 76 - return {} 77 - } 78 - 79 - reportCoverage(coverage: unknown, reportContext?: ReportContext) { 80 - this.calls.add(`reportCoverage with ${JSON.stringify(reportContext)}`) 81 - 82 - const jsonReport = JSON.stringify({ 83 - calls: Array.from(this.calls.values()), 84 - coverageReports: Array.from(this.coverageReports.values()).sort(), 85 - transformedFiles: Array.from(this.transformedFiles.values()).sort(), 86 - }, null, 2) 87 - 88 - if (existsSync('./coverage')) { 89 - rmSync('./coverage', { maxRetries: 10, recursive: true }) 90 - } 91 - 92 - mkdirSync('./coverage') 93 - writeFileSync('./coverage/custom-coverage-provider-report.json', jsonReport, 'utf-8') 94 - } 95 - 96 - onFileTransform(code: string, id: string) { 97 - const filename = normalizeFilename(id).split('?')[0] 98 - 99 - if (/\/src\//.test(filename)) { 100 - this.transformedFiles.add(filename) 101 - } 102 - 103 - return { code } 104 - } 105 - 106 - resolveOptions(): ResolvedCoverageOptions { 107 - this.calls.add('resolveOptions') 108 - 109 - return this.options 110 - } 111 - } 112 - 113 - export default CustomCoverageProviderModule
-26
test/coverage-test/custom-reporter.cjs
··· 1 - /* Istanbul uses `require`: https://github.com/istanbuljs/istanbuljs/blob/5584b50305a6a17d3573aea25c84e254d4a08b65/packages/istanbul-reports/index.js#L19 */ 2 - 3 - 'use strict' 4 - const { ReportBase } = require('istanbul-lib-report') 5 - 6 - module.exports = class CustomReporter extends ReportBase { 7 - constructor(opts) { 8 - super() 9 - 10 - if (!opts.file) { 11 - throw new Error('File is required as custom reporter parameter') 12 - } 13 - 14 - this.file = opts.file 15 - } 16 - 17 - onStart(root, context) { 18 - this.contentWriter = context.writer.writeFile(this.file) 19 - this.contentWriter.println('Start of custom coverage report') 20 - } 21 - 22 - onEnd() { 23 - this.contentWriter.println('End of custom coverage report') 24 - this.contentWriter.close() 25 - } 26 - }
+2 -7
test/coverage-test/package.json
··· 3 3 "type": "module", 4 4 "private": true, 5 5 "scripts": { 6 - "test": "pnpm test:v8 && pnpm test:istanbul && pnpm test:custom && pnpm test:browser && pnpm test:options && pnpm test:types", 7 - "test:v8": "node ./testing.mjs --provider v8", 8 - "test:custom": "node ./testing.mjs --provider custom", 9 - "test:istanbul": "node ./testing.mjs --provider istanbul", 10 - "test:browser": "node ./testing.mjs --browser --provider istanbul", 11 - "test:options": "node ./testing-options.mjs", 12 - "test:types": "vitest --typecheck.only --typecheck.tsconfig ../../tsconfig.check.json --run --reporter verbose" 6 + "test": "vitest --workspace=vitest.workspace.custom.ts" 13 7 }, 14 8 "devDependencies": { 15 9 "@ampproject/remapping": "^2.2.1", ··· 23 17 "happy-dom": "latest", 24 18 "istanbul-lib-coverage": "^3.2.0", 25 19 "istanbul-lib-report": "^3.0.1", 20 + "magic-string": "^0.30.10", 26 21 "magicast": "^0.3.3", 27 22 "unplugin-swc": "^1.4.4", 28 23 "vite": "latest",
-2
test/coverage-test/setup.ts
··· 1 - // eslint-disable-next-line no-console 2 - console.log('Test Setup File')
-257
test/coverage-test/testing-options.mjs
··· 1 - import { existsSync, readFileSync, readdirSync, rmSync, writeFileSync } from 'node:fs' 2 - import { startVitest } from 'vitest/node' 3 - 4 - /** 5 - * @typedef {NonNullable<import('vitest/config').UserConfig['test']>} Config 6 - * @typedef { () => void | Promise<void> } Callback 7 - * @typedef {{ testConfig: Config, assertionConfig?: Config, after?: Callback, before?: Callback }} TestCase 8 - */ 9 - 10 - /** @type {TestCase[]} */ 11 - const testCases = [ 12 - { 13 - testConfig: { 14 - name: 'allowExternal: true', 15 - include: ['option-tests/allow-external.test.ts'], 16 - coverage: { 17 - allowExternal: true, 18 - include: ['**/src/**', '**/test-utils/fixtures/**'], 19 - reporter: 'html', 20 - }, 21 - }, 22 - assertionConfig: { 23 - include: ['coverage-report-tests/allow-external.test.ts'], 24 - env: { VITE_COVERAGE_ALLOW_EXTERNAL: true }, 25 - }, 26 - }, 27 - { 28 - testConfig: { 29 - name: 'allowExternal: false', 30 - include: ['option-tests/allow-external.test.ts'], 31 - coverage: { 32 - allowExternal: false, 33 - include: ['**/src/**', '**/test-utils/fixtures/**'], 34 - reporter: 'html', 35 - }, 36 - }, 37 - assertionConfig: { 38 - include: ['coverage-report-tests/allow-external.test.ts'], 39 - }, 40 - }, 41 - { 42 - testConfig: { 43 - name: 'thresholds.100', 44 - include: ['option-tests/threshold-100.test.ts'], 45 - coverage: { 46 - thresholds: { 47 - 100: true, 48 - }, 49 - }, 50 - }, 51 - assertionConfig: null, 52 - }, 53 - { 54 - testConfig: { 55 - name: 'temp directory with shard', 56 - include: ['option-tests/shard.test.ts'], 57 - shard: '1/4', 58 - }, 59 - assertionConfig: null, 60 - }, 61 - { 62 - skip: !!process.env.ECOSYSTEM_CI, 63 - testConfig: { 64 - name: 'changed', 65 - changed: 'HEAD', 66 - coverage: { 67 - include: ['src'], 68 - reporter: 'json', 69 - all: true, 70 - }, 71 - }, 72 - assertionConfig: { 73 - include: ['coverage-report-tests/changed.test.ts'], 74 - }, 75 - before: () => { 76 - let content = readFileSync('./src/file-to-change.ts', 'utf8') 77 - content = content.replace('This file will be modified by test cases', 'Changed!') 78 - writeFileSync('./src/file-to-change.ts', content, 'utf8') 79 - 80 - writeFileSync('./src/new-uncovered-file.ts', ` 81 - // This file is not covered by any tests but should be picked by --changed 82 - export default function helloworld() { 83 - return 'Hello world' 84 - } 85 - `.trim(), 'utf8') 86 - }, 87 - after: () => { 88 - let content = readFileSync('./src/file-to-change.ts', 'utf8') 89 - content = content.replace('Changed!', 'This file will be modified by test cases') 90 - writeFileSync('./src/file-to-change.ts', content, 'utf8') 91 - rmSync('./src/new-uncovered-file.ts') 92 - }, 93 - }, 94 - { 95 - testConfig: { 96 - name: 'ignore empty lines', 97 - include: ['option-tests/empty-lines.test.ts'], 98 - coverage: { 99 - provider: 'v8', 100 - reporter: 'json', 101 - all: true, 102 - include: ['src/empty-lines.ts', 'src/untested-file.ts'], 103 - }, 104 - }, 105 - assertionConfig: { 106 - include: ['coverage-report-tests/ignore-empty-lines.test.ts'], 107 - }, 108 - }, 109 - { 110 - testConfig: { 111 - name: 'include empty lines', 112 - include: ['option-tests/empty-lines.test.ts'], 113 - coverage: { 114 - provider: 'v8', 115 - reporter: 'json', 116 - ignoreEmptyLines: false, 117 - all: true, 118 - include: ['src/empty-lines.ts', 'src/untested-file.ts'], 119 - }, 120 - }, 121 - assertionConfig: { 122 - include: ['coverage-report-tests/include-empty-lines.test.ts'], 123 - }, 124 - }, 125 - { 126 - testConfig: { 127 - name: 'failing thresholds', 128 - include: ['option-tests/thresholds.test.ts'], 129 - coverage: { 130 - reporter: 'text', 131 - all: false, 132 - include: ['src/utils.ts'], 133 - thresholds: { 134 - 'src/utils.ts': { 135 - branches: 100, 136 - functions: 100, 137 - lines: 100, 138 - statements: 100, 139 - }, 140 - }, 141 - }, 142 - }, 143 - after() { 144 - if (process.exitCode !== 1) { 145 - throw new Error('Expected test to fail as thresholds are not met') 146 - } 147 - 148 - process.exitCode = 0 149 - }, 150 - }, 151 - { 152 - testConfig: { 153 - name: 'remove empty coverages directory', 154 - include: ['option-tests/fixture.test.ts'], 155 - coverage: { 156 - reporter: 'text', 157 - all: false, 158 - include: ['src/utils.ts'], 159 - }, 160 - }, 161 - after() { 162 - if (existsSync('./coverage')) { 163 - if (readdirSync('./coverage').length !== 0) { 164 - throw new Error('Test case expected coverage directory to be empty') 165 - } 166 - 167 - throw new Error('Empty coverage directory was not cleaned') 168 - } 169 - }, 170 - }, 171 - ...[1, 2, 3].map(index => ({ 172 - testConfig: { 173 - name: `generate #${index} blob report`, 174 - include: ['option-tests/merge-fixture-*.test.ts'], 175 - reporters: 'blob', 176 - shard: `${index}/3`, 177 - coverage: { 178 - reporter: [], 179 - all: false, 180 - include: ['src'], 181 - }, 182 - }, 183 - })), 184 - { 185 - testConfig: { 186 - name: 'merge blob reports', 187 - // Pass default value - this option is publicly only available via CLI so it's a bit hacky usage here 188 - mergeReports: '.vitest-reports', 189 - reporter: 'dot', 190 - coverage: { 191 - reporter: 'json', 192 - all: false, 193 - }, 194 - }, 195 - assertionConfig: { 196 - include: ['coverage-report-tests/merge-reports.test.ts'], 197 - }, 198 - }, 199 - { 200 - testConfig: { 201 - name: 'thresholds autoUpdate', 202 - include: ['option-tests/thresholds-auto-update.test.ts'], 203 - coverage: { provider: 'v8', enabled: false }, 204 - }, 205 - }, 206 - ] 207 - 208 - for (const provider of ['v8', 'istanbul']) { 209 - for (const { after, before, testConfig, assertionConfig, skip } of testCases) { 210 - if (skip) { 211 - continue 212 - } 213 - // Test config may specify which provider the test is for 214 - if (testConfig.coverage?.provider && testConfig.coverage.provider !== provider) { 215 - continue 216 - } 217 - 218 - await before?.() 219 - 220 - // Run test case 221 - await startVitest('test', ['option-tests/'], { 222 - config: false, 223 - watch: false, 224 - ...testConfig, 225 - name: `${provider} - ${testConfig.name}`, 226 - coverage: { 227 - enabled: true, 228 - clean: true, 229 - all: false, 230 - reporter: [], 231 - provider, 232 - ...testConfig.coverage, 233 - }, 234 - }) 235 - 236 - // Check generated coverage report 237 - if (assertionConfig) { 238 - await startVitest('test', ['coverage-report-tests'], { 239 - config: false, 240 - watch: false, 241 - ...assertionConfig, 242 - name: `${provider} - assert ${testConfig.name}`, 243 - }) 244 - } 245 - 246 - await after?.() 247 - 248 - checkExit() 249 - } 250 - } 251 - 252 - function checkExit() { 253 - if (process.exitCode) { 254 - console.error(`Exit code was set to ${process.exitCode}. Failing tests`) 255 - process.exit(process.exitCode) 256 - } 257 - }
-101
test/coverage-test/testing.mjs
··· 1 - import { startVitest } from 'vitest/node' 2 - 3 - // Set this to true when intentionally updating the snapshots 4 - const UPDATE_SNAPSHOTS = false 5 - 6 - const provider = process.argv[1 + process.argv.indexOf('--provider')] 7 - const isBrowser = process.argv.includes('--browser') 8 - const isCI = process.env.GITHUB_ACTIONS 9 - process.env.COVERAGE_PROVIDER = provider 10 - 11 - // TODO: Fix flakiness and enable on CI -- browser picks test files that don't exist and fails, issue #5165 12 - if (isCI && isBrowser) { 13 - process.exit(0) 14 - } 15 - 16 - const poolConfigs = [ 17 - { pool: 'threads', poolOptions: { threads: { } } }, 18 - { pool: 'forks', poolOptions: { forks: { } } }, 19 - { pool: 'threads', poolOptions: { threads: { singleThread: true } } }, 20 - 21 - // TODO: Figure out what's wrong with vmThreads and coverage test "runDynamicFileCJS". This issue is likely present in main branch too. 22 - // { pool: 'vmThreads', poolOptions: { vmThreads: { } } }, 23 - ] 24 - 25 - // Threads have no effect in browser mode 26 - if (isBrowser) { 27 - poolConfigs.splice(1) 28 - } 29 - 30 - const configs = [ 31 - // Run test cases. Generates coverage report. 32 - ['test/', { 33 - include: ['test/*.test.*'], 34 - exclude: [ 35 - 'coverage-report-tests/**/*', 36 - // TODO: Include once mocking is supported in browser 37 - isBrowser && '**/no-esbuild-transform.test.js', 38 - ].filter(Boolean), 39 - coverage: { enabled: true }, 40 - browser: { enabled: isBrowser, name: 'chromium', provider: 'playwright', headless: true }, 41 - 42 - // Regression vitest#3330 43 - reporters: ['default', 'junit'], 44 - outputFile: { junit: 'coverage/junit.xml' }, 45 - }], 46 - 47 - // Run tests for checking coverage report contents. 48 - ['coverage-report-tests', { 49 - include: [ 50 - ['v8', 'istanbul'].includes(provider) && './coverage-report-tests/generic.report.test.ts', 51 - `./coverage-report-tests/${provider}.report.test.ts`, 52 - ].filter(Boolean), 53 - coverage: { enabled: false, clean: false }, 54 - }], 55 - ] 56 - 57 - // Prevent the "vitest/src/node/browser/webdriver.ts" from calling process.exit 58 - const exit = process.exit 59 - process.exit = () => !isBrowser && exit() 60 - 61 - for (const { pool, poolOptions } of poolConfigs) { 62 - for (const isolate of [true, false]) { 63 - for (const [directory, config] of configs) { 64 - // Retry flaky browser tests 65 - const retries = Array(config.browser?.enabled ? 3 : 1).fill(0) 66 - 67 - for (const retry of retries.keys()) { 68 - const poolConfig = { 69 - pool, 70 - poolOptions: { 71 - [pool]: { 72 - ...poolOptions[pool], 73 - isolate, 74 - }, 75 - }, 76 - } 77 - 78 - await startVitest('test', [directory], { 79 - name: `With settings: ${JSON.stringify({ ...poolConfig, directory, browser: config.browser?.enabled })}`, 80 - ...config, 81 - update: UPDATE_SNAPSHOTS, 82 - ...poolConfig, 83 - }) 84 - 85 - if (process.exitCode && retry === retries.length - 1) { 86 - console.error(`process.exitCode was set to ${process.exitCode}, exiting.`) 87 - exit() 88 - } 89 - else if (process.exitCode) { 90 - process.exitCode = null 91 - console.warn(`Browser tests failed, retrying ${1 + retry}/${retries.length - 1}...`) 92 - } 93 - else { 94 - break 95 - } 96 - } 97 - } 98 - } 99 - } 100 - 101 - exit()
-1
test/coverage-test/typings.d.ts
··· 1 - declare const MY_CONSTANT: string
+101
test/coverage-test/utils.ts
··· 1 + import { readFileSync } from 'node:fs' 2 + import { resolve } from 'node:path' 3 + import { fileURLToPath } from 'node:url' 4 + import { normalize } from 'pathe' 5 + import libCoverage from 'istanbul-lib-coverage' 6 + import type { FileCoverageData } from 'istanbul-lib-coverage' 7 + import type { TestFunction, UserConfig } from 'vitest' 8 + import { describe as vitestDescribe, test as vitestTest } from 'vitest' 9 + import * as testUtils from '../test-utils' 10 + 11 + export function test(name: string, fn: TestFunction, skip = false) { 12 + if (process.env.COVERAGE_TEST !== 'true') { 13 + return vitestTest.skipIf(skip)(name, fn) 14 + } 15 + } 16 + 17 + export function describe(name: string, fn: Function) { 18 + if (process.env.COVERAGE_TEST !== 'true') { 19 + return vitestDescribe(name, () => fn()) 20 + } 21 + } 22 + 23 + export function coverageTest(name: string, fn: TestFunction) { 24 + if (process.env.COVERAGE_TEST === 'true') { 25 + return vitestTest(name, fn) 26 + } 27 + } 28 + 29 + export async function runVitest(config: UserConfig, options = { throwOnError: true }) { 30 + const provider = process.env.COVERAGE_PROVIDER as any 31 + 32 + const result = await testUtils.runVitest({ 33 + config: 'fixtures/configs/vitest.config.ts', 34 + pool: 'threads', 35 + ...config, 36 + env: { 37 + COVERAGE_TEST: 'true', 38 + ...config.env, 39 + }, 40 + coverage: { 41 + enabled: true, 42 + reporter: [], 43 + ...config.coverage, 44 + provider, 45 + customProviderModule: provider === 'custom' ? 'fixtures/custom-provider' : undefined, 46 + }, 47 + browser: { 48 + enabled: process.env.COVERAGE_BROWSER === 'true', 49 + headless: true, 50 + name: 'chromium', 51 + provider: 'playwright', 52 + }, 53 + }) 54 + 55 + if (options.throwOnError) { 56 + if (result.stderr !== '') { 57 + throw new Error(result.stderr) 58 + } 59 + } 60 + 61 + return result 62 + } 63 + 64 + /** 65 + * Read JSON coverage report from file system. 66 + * Normalizes paths to keep contents consistent between OS's 67 + */ 68 + export async function readCoverageJson(name = './coverage/coverage-final.json') { 69 + const jsonReport = JSON.parse(readFileSync(name, 'utf8')) as Record<string, FileCoverageData> 70 + 71 + const normalizedReport: typeof jsonReport = {} 72 + 73 + for (const [filename, coverage] of Object.entries(jsonReport)) { 74 + coverage.path = normalizeFilename(coverage.path) 75 + normalizedReport[normalizeFilename(filename)] = coverage 76 + } 77 + 78 + return normalizedReport 79 + } 80 + 81 + /** 82 + * Read coverage report from file system as Istanbul's `CoverageMap` 83 + */ 84 + export async function readCoverageMap(name = './coverage/coverage-final.json') { 85 + const coverageJson = await readCoverageJson(name) 86 + return libCoverage.createCoverageMap(coverageJson) 87 + } 88 + 89 + export function normalizeFilename(filename: string) { 90 + return normalize(filename) 91 + .replace(normalize(process.cwd()), '<process-cwd>') 92 + .replace(normalize(resolve(process.cwd(), '../../')), '<project-root>') 93 + } 94 + 95 + export function isV8Provider() { 96 + return process.env.COVERAGE_PROVIDER === 'v8' 97 + } 98 + 99 + export function normalizeURL(importMetaURL: string) { 100 + return normalize(fileURLToPath(importMetaURL)) 101 + }
+19 -141
test/coverage-test/vitest.config.ts
··· 1 - import { resolve } from 'pathe' 2 - import swc from 'unplugin-swc' 3 1 import { defineConfig } from 'vitest/config' 4 - import vue from '@vitejs/plugin-vue' 5 - import MagicString from 'magic-string' 6 - import remapping from '@ampproject/remapping' 7 - import type { Plugin } from 'vite' 8 2 9 - const provider = process.argv[1 + process.argv.indexOf('--provider')] 10 - 11 - export default defineConfig(_ => ({ 12 - plugins: [ 13 - vue(), 14 - MultiTransformPlugin(), 15 - VirtualFilesPlugin(), 16 - DecoratorsPlugin(), 17 - ], 18 - define: { 19 - MY_CONSTANT: '"my constant"', 20 - }, 3 + export default defineConfig({ 21 4 test: { 22 - watch: false, 23 - coverage: { 24 - provider: provider as any, 25 - customProviderModule: provider === 'custom' ? 'custom-provider' : undefined, 26 - include: ['src/**'], 27 - clean: true, 28 - reportOnFailure: true, 29 - reporter: [ 30 - 'text', 31 - ['html'], 32 - ['lcov', {}], 33 - ['json', { file: 'custom-json-report-name.json' }], 34 - [resolve('./custom-reporter.cjs'), { file: 'custom-reporter-output.md' }], 35 - ], 36 - 37 - // These will be updated by tests and reseted back by generic.report.test.ts 38 - thresholds: { 39 - 'autoUpdate': true, 40 - 'functions': 0, 41 - 'branches': 1.01, 42 - 'lines': 0, 43 - 'statements': 1.01, 44 - 45 - // These need to pass both V8 and istanbul 46 - '**/function-count.ts': { 47 - statements: 50, 48 - branches: 99, 49 - functions: 59, 50 - lines: 50, 51 - }, 5 + reporters: 'basic', 6 + isolate: false, 7 + poolOptions: { 8 + threads: { 9 + // Tests may have side effects, e.g. writing files to disk, 10 + singleThread: true, 52 11 }, 53 12 }, 54 - setupFiles: [ 55 - resolve(__dirname, './setup.ts'), 56 - './src/another-setup.ts', 57 - ], 13 + onConsoleLog(log) { 14 + if (log.includes('ERROR: Coverage for')) { 15 + // Ignore threshold error messages 16 + return false 17 + } 18 + 19 + if (log.includes('Updating thresholds to configuration file.')) { 20 + // Ignore threshold updating messages 21 + return false 22 + } 23 + }, 58 24 }, 59 - })) 60 - 61 - /* 62 - * Transforms `multi-environment.ts` differently based on test environment (JSDOM/Node) 63 - * so that there are multiple different source maps for a single file. 64 - * This causes a case where coverage report is incorrect if sourcemaps are not picked based on transform mode. 65 - */ 66 - function MultiTransformPlugin(): Plugin { 67 - return { 68 - name: 'vitest-custom-multi-transform', 69 - enforce: 'pre', 70 - transform(code, id, options) { 71 - if (id.includes('src/multi-environment')) { 72 - const ssr = options?.ssr || false 73 - const transforMode = `transformMode is ${ssr ? 'ssr' : 'csr'}` 74 - const padding = '\n*****'.repeat(ssr ? 0 : 15) 75 - 76 - const transformed = new MagicString(code) 77 - transformed.replace('\'default-padding\'', `\`${transforMode} ${padding}\``) 78 - 79 - const map = remapping( 80 - [transformed.generateMap({ hires: true }), this.getCombinedSourcemap() as any], 81 - () => null, 82 - ) as any 83 - 84 - return { code: transformed.toString(), map } 85 - } 86 - }, 87 - } 88 - } 89 - 90 - // Simulates Vite's virtual files: https://vitejs.dev/guide/api-plugin.html#virtual-modules-convention 91 - function VirtualFilesPlugin(): Plugin { 92 - return { 93 - name: 'vitest-custom-virtual-files', 94 - resolveId(id) { 95 - if (id === 'virtual:vitest-custom-virtual-file-1') { 96 - return 'src/virtual:vitest-custom-virtual-file-1.ts' 97 - } 98 - 99 - if (id === '\0vitest-custom-virtual-file-2') { 100 - return 'src/\0vitest-custom-virtual-file-2.ts' 101 - } 102 - }, 103 - load(id) { 104 - if (id === 'src/virtual:vitest-custom-virtual-file-1.ts') { 105 - return ` 106 - const virtualFile = "This file should be excluded from coverage report #1" 107 - export default virtualFile; 108 - ` 109 - } 110 - 111 - // Vitest browser resolves this as "\x00", Node as "__x00__" 112 - if (id === 'src/__x00__vitest-custom-virtual-file-2.ts' || id === 'src/\x00vitest-custom-virtual-file-2.ts') { 113 - return ` 114 - const virtualFile = "This file should be excluded from coverage report #2" 115 - export default virtualFile; 116 - ` 117 - } 118 - }, 119 - } 120 - } 121 - 122 - function DecoratorsPlugin(): Plugin { 123 - const plugin = swc.vite({ 124 - jsc: { 125 - target: 'esnext', 126 - parser: { 127 - syntax: 'typescript', 128 - decorators: true, 129 - }, 130 - transform: { 131 - legacyDecorator: true, 132 - decoratorMetadata: true, 133 - }, 134 - }, 135 - }) 136 - 137 - return { 138 - name: 'custom-swc-decorator', 139 - enforce: 'pre', 140 - transform(code, id, options) { 141 - if (id.endsWith('decorators.ts')) { 142 - // @ts-expect-error -- Ignore complex type 143 - return plugin.transform(code, id, options) 144 - } 145 - }, 146 - } 147 - } 25 + })
+94
test/coverage-test/vitest.workspace.custom.ts
··· 1 + import { defineConfig, defineWorkspace } from 'vitest/config' 2 + 3 + const GENERIC_TESTS = 'test/**.test.ts' 4 + const V8_TESTS = 'test/**.v8.test.ts' 5 + const ISTANBUL_TESTS = 'test/**.istanbul.test.ts' 6 + const CUSTOM_TESTS = 'test/**.custom.test.ts' 7 + const UNIT_TESTS = 'test/**.unit.test.ts' 8 + const BROWSER_TESTS = 'test/**.browser.test.ts' 9 + 10 + const config = defineConfig({ 11 + test: { 12 + pool: 'threads', 13 + }, 14 + }) 15 + 16 + export default defineWorkspace([ 17 + // Test cases for v8-provider 18 + { 19 + test: { 20 + ...config.test, 21 + name: 'v8', 22 + env: { COVERAGE_PROVIDER: 'v8' }, 23 + include: [GENERIC_TESTS, V8_TESTS], 24 + exclude: [ 25 + ISTANBUL_TESTS, 26 + UNIT_TESTS, 27 + CUSTOM_TESTS, 28 + BROWSER_TESTS, 29 + ], 30 + }, 31 + }, 32 + 33 + // Test cases for istanbul-provider 34 + { 35 + test: { 36 + ...config.test, 37 + name: 'istanbul', 38 + env: { COVERAGE_PROVIDER: 'istanbul' }, 39 + include: [GENERIC_TESTS, ISTANBUL_TESTS], 40 + exclude: [ 41 + V8_TESTS, 42 + UNIT_TESTS, 43 + CUSTOM_TESTS, 44 + BROWSER_TESTS, 45 + ], 46 + }, 47 + }, 48 + 49 + // Test cases for custom-provider 50 + { 51 + test: { 52 + ...config.test, 53 + name: 'custom', 54 + env: { COVERAGE_PROVIDER: 'custom' }, 55 + include: [CUSTOM_TESTS], 56 + }, 57 + }, 58 + 59 + // Test cases for browser. Browser mode itself is activated by COVERAGE_BROWSER env var. 60 + { 61 + test: { 62 + ...config.test, 63 + name: 'browser', 64 + env: { COVERAGE_PROVIDER: 'istanbul', COVERAGE_BROWSER: 'true' }, 65 + include: [ 66 + BROWSER_TESTS, 67 + 68 + // Other non-provider-specific tests that should be run on browser mode as well 69 + '**/ignore-hints.test.ts', 70 + '**/multi-suite.test.ts', 71 + '**/setup-files.test.ts', 72 + '**/results-snapshot.test.ts', 73 + '**/reporters.test.ts', 74 + '**/temporary-files.test.ts', 75 + '**/test-reporter-conflicts.test.ts', 76 + '**/vue.test.ts', 77 + ], 78 + }, 79 + }, 80 + 81 + // Test cases that aren't provider specific 82 + { 83 + test: { 84 + ...config.test, 85 + name: 'unit', 86 + include: [UNIT_TESTS], 87 + typecheck: { 88 + enabled: true, 89 + include: ['**/test/*.test-d.ts'], 90 + tsconfig: '../../tsconfig.check.json', 91 + }, 92 + }, 93 + }, 94 + ])
-20
test/coverage-test/coverage-report-tests/allow-external.test.ts
··· 1 - import fs from 'node:fs' 2 - import { expect, test } from 'vitest' 3 - 4 - const allowExternal = import.meta.env.VITE_COVERAGE_ALLOW_EXTERNAL 5 - 6 - test.skipIf(!allowExternal)('{ allowExternal: true } includes files outside project root', async () => { 7 - expect(fs.existsSync('./coverage/test-utils/fixtures/math.ts.html')).toBe(true) 8 - 9 - // Files inside project root should always be included 10 - expect(fs.existsSync('./coverage/coverage-test/src/utils.ts.html')).toBe(true) 11 - }) 12 - 13 - test.skipIf(allowExternal)('{ allowExternal: false } excludes files outside project root', async () => { 14 - expect(fs.existsSync('./coverage/test-utils/fixtures/math.ts.html')).toBe(false) 15 - expect(fs.existsSync('./test-utils/fixtures/math.ts.html')).toBe(false) 16 - expect(fs.existsSync('./fixtures/math.ts.html')).toBe(false) 17 - 18 - // Files inside project root should always be included 19 - expect(fs.existsSync('./coverage/utils.ts.html')).toBe(true) 20 - })
-24
test/coverage-test/coverage-report-tests/changed.test.ts
··· 1 - import { expect, test } from 'vitest' 2 - import libCoverage from 'istanbul-lib-coverage' 3 - 4 - import { readCoverageJson } from './utils' 5 - 6 - test('report contains only the changed files', async () => { 7 - const coverageJson = await readCoverageJson('./coverage/coverage-final.json') 8 - const coverageMap = libCoverage.createCoverageMap(coverageJson as any) 9 - 10 - // Note that this test may fail if you have new files in "vitest/test/coverage-test/src" 11 - // and have not yet committed those 12 - expect(coverageMap.files()).toMatchInlineSnapshot(` 13 - [ 14 - "<process-cwd>/src/file-to-change.ts", 15 - "<process-cwd>/src/new-uncovered-file.ts", 16 - ] 17 - `) 18 - 19 - const uncoveredFile = coverageMap.fileCoverageFor('<process-cwd>/src/new-uncovered-file.ts').toSummary() 20 - expect(uncoveredFile.lines.pct).toBe(0) 21 - 22 - const changedFile = coverageMap.fileCoverageFor('<process-cwd>/src/file-to-change.ts').toSummary() 23 - expect(changedFile.lines.pct).toBeGreaterThanOrEqual(50) 24 - })
-12
test/coverage-test/coverage-report-tests/custom.report.test.ts
··· 1 - /* 2 - * Custom coverage provider specific test cases 3 - */ 4 - 5 - import { readFileSync } from 'node:fs' 6 - import { expect, test } from 'vitest' 7 - 8 - test('custom json report', async () => { 9 - const report = readFileSync('./coverage/custom-coverage-provider-report.json', 'utf-8') 10 - 11 - expect(JSON.parse(report)).toMatchSnapshot() 12 - })
-217
test/coverage-test/coverage-report-tests/generic.report.test.ts
··· 1 - /* 2 - * Test cases shared by both coverage providers 3 - */ 4 - 5 - import fs from 'node:fs' 6 - import { resolve } from 'pathe' 7 - import { parseModule } from 'magicast' 8 - import { expect, test } from 'vitest' 9 - import libCoverage from 'istanbul-lib-coverage' 10 - 11 - import { readCoverageJson } from './utils' 12 - 13 - test('html report', async () => { 14 - const coveragePath = resolve('./coverage/src') 15 - const files = fs.readdirSync(coveragePath) 16 - 17 - expect(files).toContain('index.html') 18 - expect(files).toContain('index.mts.html') 19 - expect(files).toContain('Hello.vue.html') 20 - }) 21 - 22 - test('lcov report', async () => { 23 - const coveragePath = resolve('./coverage') 24 - const files = fs.readdirSync(coveragePath) 25 - 26 - expect(files).toContain('lcov.info') 27 - 28 - const lcovReport = resolve('./coverage/lcov-report') 29 - const lcovReportFiles = fs.readdirSync(lcovReport) 30 - 31 - expect(lcovReportFiles).toContain('index.html') 32 - }) 33 - 34 - test('custom report', async () => { 35 - const coveragePath = resolve('./coverage') 36 - const files = fs.readdirSync(coveragePath) 37 - 38 - expect(files).toContain('custom-reporter-output.md') 39 - 40 - const content = fs.readFileSync(resolve(coveragePath, 'custom-reporter-output.md'), 'utf-8') 41 - expect(content).toMatchInlineSnapshot(` 42 - "Start of custom coverage report 43 - End of custom coverage report 44 - " 45 - `) 46 - }) 47 - 48 - test('all includes untested files', () => { 49 - const coveragePath = resolve('./coverage/src') 50 - const files = fs.readdirSync(coveragePath) 51 - 52 - expect(files).toContain('untested-file.ts.html') 53 - 54 - // Directories starting with dot should be excluded 55 - expect(files).not.toContain('.should-be-excluded-from-coverage/excluded-from-coverage.ts.html') 56 - expect(files).not.toContain('.should-be-excluded-from-coverage') 57 - expect(files).not.toContain('excluded-from-coverage.ts.html') 58 - }) 59 - 60 - test('files should not contain query parameters', () => { 61 - const coveragePath = resolve('./coverage/src/Counter') 62 - const files = fs.readdirSync(coveragePath) 63 - 64 - expect(files).toContain('index.html') 65 - expect(files).toContain('Counter.vue.html') 66 - expect(files).toContain('Counter.component.ts.html') 67 - expect(files).not.toContain('Counter.component.ts?vue&type=script&src=true&lang.ts.html') 68 - }) 69 - 70 - test('file using import.meta.env is included in report', async () => { 71 - const coveragePath = resolve('./coverage/src') 72 - const files = fs.readdirSync(coveragePath) 73 - 74 - expect(files).toContain('importEnv.ts.html') 75 - }) 76 - 77 - test('files should not contain a setup file', () => { 78 - const coveragePath = resolve('./coverage') 79 - const files = fs.readdirSync(coveragePath) 80 - 81 - expect(files).not.toContain('coverage-test') 82 - expect(files).not.toContain('setup.ts.html') 83 - 84 - const coverageSrcPath = resolve('./coverage/src') 85 - const srcFiles = fs.readdirSync(coverageSrcPath) 86 - 87 - expect(srcFiles).not.toContain('another-setup.ts.html') 88 - }) 89 - 90 - test('thresholds.autoUpdate updates thresholds', async () => { 91 - const configFilename = resolve('./vitest.config.ts') 92 - const mod = parseModule(fs.readFileSync(configFilename, 'utf-8')) 93 - const thresholds = mod.exports.default.$args[0].$body.test.coverage.thresholds 94 - 95 - // Configuration has fixed value of 1.01 and 0 set for each threshold 96 - expect(Number.parseInt(thresholds.functions)).toBeGreaterThan(1.01) 97 - expect(Number.parseInt(thresholds.branches)).toBeGreaterThan(1.01) 98 - expect(Number.parseInt(thresholds.lines)).toBeGreaterThan(1.01) 99 - expect(Number.parseInt(thresholds.statements)).toBeGreaterThan(1.01) 100 - 101 - // Check file coverage for glob 102 - const coverageJson = await readCoverageJson() 103 - const coverageMap = libCoverage.createCoverageMap(coverageJson as any) 104 - 105 - const fileCoverage = coverageMap.fileCoverageFor('<process-cwd>/src/function-count.ts') 106 - const summary = fileCoverage.toSummary() 107 - expect(summary.branches.pct).toBe(100) 108 - expect(summary.functions.pct).toBe(60) 109 - 110 - if (process.env.COVERAGE_PROVIDER === 'v8') { 111 - expect(summary.statements.pct).toBe(70.58) 112 - expect(summary.lines.pct).toBe(70.58) 113 - } 114 - else { 115 - expect(summary.statements.pct).toBe(71.42) 116 - expect(summary.lines.pct).toBe(71.42) 117 - } 118 - 119 - // Update thresholds back to fixed values 120 - thresholds.functions = 0 121 - thresholds.lines = 0 122 - thresholds.branches = 1.01 123 - thresholds.statements = 1.01 124 - thresholds['**/function-count.ts'].statements = 50 125 - thresholds['**/function-count.ts'].branches = 99 126 - thresholds['**/function-count.ts'].functions = 59 127 - thresholds['**/function-count.ts'].lines = 50 128 - 129 - fs.writeFileSync(configFilename, `${mod.generate().code}\n`, 'utf-8') 130 - }) 131 - 132 - test('function count is correct', async () => { 133 - const coverageJson = await readCoverageJson() 134 - const coverageMap = libCoverage.createCoverageMap(coverageJson as any) 135 - const fileCoverage = coverageMap.fileCoverageFor('<process-cwd>/src/function-count.ts') 136 - 137 - const { functions } = fileCoverage.toSummary() 138 - 139 - expect(functions.total).toBe(5) 140 - expect(functions.covered).toBe(3) 141 - }) 142 - 143 - test('coverage provider does not conflict with built-in reporter\'s outputFile', async () => { 144 - const coveragePath = resolve('./coverage') 145 - const files = fs.readdirSync(coveragePath) 146 - 147 - expect(files).toContain('junit.xml') 148 - }) 149 - 150 - test('virtual files should be excluded', () => { 151 - const files = fs.readdirSync(resolve('./coverage')) 152 - const srcFiles = fs.readdirSync(resolve('./coverage/src')) 153 - 154 - for (const file of [...files, ...srcFiles]) { 155 - expect(file).not.toContain('virtual:') 156 - 157 - // Vitest in node 158 - expect(file).not.toContain('__x00__') 159 - expect(file).not.toContain('\0') 160 - 161 - // Vitest browser 162 - expect(file).not.toContain('\x00') 163 - } 164 - }) 165 - 166 - test('multi environment coverage is merged correctly', async () => { 167 - const coverageJson = await readCoverageJson() 168 - const coverageMap = libCoverage.createCoverageMap(coverageJson as any) 169 - const fileCoverage = coverageMap.fileCoverageFor('<process-cwd>/src/multi-environment.ts') 170 - const lineCoverage = fileCoverage.getLineCoverage() 171 - 172 - // Condition not covered by any test 173 - expect(lineCoverage[13]).toBe(0) 174 - 175 - // Condition covered by SSR test but not by Web 176 - expect(lineCoverage[18]).toBe(1) 177 - 178 - // Condition not covered by any test 179 - expect(lineCoverage[22]).toBe(0) 180 - 181 - // Condition covered by Web test but not by SSR 182 - expect(lineCoverage[26]).toBe(1) 183 - 184 - // Condition covered by both tests 185 - expect(lineCoverage[30]).toBe(2) 186 - }) 187 - 188 - test('decorators generated metadata is ignored', async () => { 189 - const coverageJson = await readCoverageJson() 190 - const coverageMap = libCoverage.createCoverageMap(coverageJson as any) 191 - const fileCoverage = coverageMap.fileCoverageFor('<process-cwd>/src/decorators.ts') 192 - const lineCoverage = fileCoverage.getLineCoverage() 193 - const branchCoverage = fileCoverage.getBranchCoverageByLine() 194 - 195 - // Decorator should not be uncovered - on V8 this is marked as covered, on Istanbul it's excluded from report 196 - if (process.env.COVERAGE_PROVIDER === 'v8') { 197 - expect(lineCoverage['4']).toBe(1) 198 - expect(branchCoverage['4'].coverage).toBe(100) 199 - } 200 - else { 201 - expect(lineCoverage['4']).toBeUndefined() 202 - expect(branchCoverage['4']).toBeUndefined() 203 - } 204 - 205 - // Covered branch should be marked correctly 206 - expect(lineCoverage['7']).toBe(1) 207 - 208 - // Uncovered branch should be marked correctly 209 - expect(lineCoverage['12']).toBe(0) 210 - }) 211 - 212 - test('temporary files are removed after test', async () => { 213 - const coveragePath = resolve('./coverage') 214 - const files = fs.readdirSync(coveragePath) 215 - 216 - expect(files).not.toContain('.tmp') 217 - })
-108
test/coverage-test/coverage-report-tests/ignore-empty-lines.test.ts
··· 1 - import { beforeAll, expect, test } from 'vitest' 2 - import libCoverage from 'istanbul-lib-coverage' 3 - 4 - import { readCoverageJson } from './utils' 5 - 6 - type CoveredLine = 1 7 - type UncoveredLine = 0 8 - type IgnoredLine = undefined 9 - 10 - // Key is 1-based line number 11 - type LineCoverage = Record<number, CoveredLine | UncoveredLine | IgnoredLine> 12 - 13 - let coveredFileLines: LineCoverage 14 - let uncoveredFileLines: LineCoverage 15 - 16 - beforeAll(async () => { 17 - const coverageJson = await readCoverageJson('./coverage/coverage-final.json') 18 - const coverageMap = libCoverage.createCoverageMap(coverageJson as any) 19 - 20 - coveredFileLines = coverageMap.fileCoverageFor('<process-cwd>/src/empty-lines.ts').getLineCoverage() as typeof coveredFileLines 21 - uncoveredFileLines = coverageMap.fileCoverageFor('<process-cwd>/src/untested-file.ts').getLineCoverage() as typeof uncoveredFileLines 22 - }) 23 - 24 - test('empty lines are ignored', async () => { 25 - expect(coveredFileLines[12]).toBe(undefined) 26 - expect(coveredFileLines[14]).toBe(undefined) 27 - expect(coveredFileLines[19]).toBe(undefined) 28 - expect(coveredFileLines[27]).toBe(undefined) 29 - expect(coveredFileLines[30]).toBe(undefined) 30 - 31 - expect(uncoveredFileLines[5]).toBe(undefined) 32 - expect(uncoveredFileLines[7]).toBe(undefined) 33 - }) 34 - 35 - test('comments are ignored', async () => { 36 - expect(coveredFileLines[1]).toBe(undefined) 37 - expect(coveredFileLines[3]).toBe(undefined) 38 - expect(coveredFileLines[4]).toBe(undefined) 39 - expect(coveredFileLines[5]).toBe(undefined) 40 - expect(coveredFileLines[6]).toBe(undefined) 41 - expect(coveredFileLines[7]).toBe(undefined) 42 - expect(coveredFileLines[9]).toBe(undefined) 43 - expect(coveredFileLines[16]).toBe(undefined) 44 - 45 - expect(uncoveredFileLines[1]).toBe(undefined) 46 - expect(uncoveredFileLines[2]).toBe(undefined) 47 - expect(uncoveredFileLines[3]).toBe(undefined) 48 - expect(uncoveredFileLines[4]).toBe(undefined) 49 - expect(uncoveredFileLines[6]).toBe(undefined) 50 - expect(uncoveredFileLines[13]).toBe(undefined) 51 - expect(uncoveredFileLines[20]).toBe(undefined) 52 - expect(uncoveredFileLines[34]).toBe(undefined) 53 - expect(uncoveredFileLines[45]).toBe(undefined) 54 - }) 55 - 56 - test('ignore hints are ignored', () => { 57 - expect(uncoveredFileLines[38]).toBe(undefined) 58 - expect(uncoveredFileLines[39]).toBe(undefined) 59 - expect(uncoveredFileLines[40]).toBe(undefined) 60 - expect(uncoveredFileLines[41]).toBe(undefined) 61 - expect(uncoveredFileLines[42]).toBe(undefined) 62 - expect(uncoveredFileLines[43]).toBe(undefined) 63 - }) 64 - 65 - test('typescript types are ignored', () => { 66 - expect(coveredFileLines[13]).toBe(undefined) 67 - expect(coveredFileLines[20]).toBe(undefined) 68 - expect(coveredFileLines[21]).toBe(undefined) 69 - expect(coveredFileLines[22]).toBe(undefined) 70 - expect(coveredFileLines[23]).toBe(undefined) 71 - expect(coveredFileLines[24]).toBe(undefined) 72 - expect(coveredFileLines[25]).toBe(undefined) 73 - expect(coveredFileLines[26]).toBe(undefined) 74 - 75 - expect(uncoveredFileLines[17]).toBe(undefined) 76 - expect(uncoveredFileLines[25]).toBe(undefined) 77 - expect(uncoveredFileLines[26]).toBe(undefined) 78 - expect(uncoveredFileLines[27]).toBe(undefined) 79 - expect(uncoveredFileLines[28]).toBe(undefined) 80 - expect(uncoveredFileLines[29]).toBe(undefined) 81 - expect(uncoveredFileLines[30]).toBe(undefined) 82 - expect(uncoveredFileLines[31]).toBe(undefined) 83 - }) 84 - 85 - test('runtime code is not ignored', () => { 86 - // Covered 87 - expect(coveredFileLines[2]).toBe(1) 88 - expect(coveredFileLines[8]).toBe(1) 89 - expect(coveredFileLines[15]).toBe(1) 90 - expect(coveredFileLines[28]).toBe(1) 91 - 92 - // Uncovered 93 - expect(coveredFileLines[10]).toBe(0) 94 - expect(coveredFileLines[17]).toBe(0) 95 - 96 - // Uncovered 97 - expect(uncoveredFileLines[8]).toBe(0) 98 - expect(uncoveredFileLines[9]).toBe(0) 99 - expect(uncoveredFileLines[10]).toBe(0) 100 - expect(uncoveredFileLines[12]).toBe(0) 101 - expect(uncoveredFileLines[14]).toBe(0) 102 - expect(uncoveredFileLines[19]).toBe(0) 103 - expect(uncoveredFileLines[21]).toBe(0) 104 - expect(uncoveredFileLines[24]).toBe(0) 105 - expect(uncoveredFileLines[33]).toBe(0) 106 - expect(uncoveredFileLines[35]).toBe(0) 107 - expect(uncoveredFileLines[46]).toBe(0) 108 - })
-42
test/coverage-test/coverage-report-tests/include-empty-lines.test.ts
··· 1 - import { beforeAll, expect, test } from 'vitest' 2 - import libCoverage from 'istanbul-lib-coverage' 3 - 4 - import { readCoverageJson } from './utils' 5 - 6 - // Key is 1-based line number 7 - type LineCoverage = Record<number, number> 8 - 9 - let coveredFileLines: LineCoverage 10 - let uncoveredFileLines: LineCoverage 11 - 12 - beforeAll(async () => { 13 - const coverageJson = await readCoverageJson('./coverage/coverage-final.json') 14 - const coverageMap = libCoverage.createCoverageMap(coverageJson as any) 15 - 16 - coveredFileLines = coverageMap.fileCoverageFor('<process-cwd>/src/empty-lines.ts').getLineCoverage() as typeof coveredFileLines 17 - uncoveredFileLines = coverageMap.fileCoverageFor('<process-cwd>/src/untested-file.ts').getLineCoverage() as typeof uncoveredFileLines 18 - }) 19 - 20 - test('lines are included', async () => { 21 - for (const line of range(29)) { 22 - expect(coveredFileLines[line], `Line #${line}`).not.toBe(undefined) 23 - expect(coveredFileLines[line], `Line #${line}`).toBeTypeOf('number') 24 - } 25 - 26 - for (const lines of [range(37), range(4, { base: 44 })]) { 27 - for (const line of lines) { 28 - expect(uncoveredFileLines[line], `Line #${line}`).not.toBe(undefined) 29 - expect(uncoveredFileLines[line], `Line #${line}`).toBeTypeOf('number') 30 - } 31 - } 32 - }) 33 - 34 - test('lines with ignore hints are ignored', () => { 35 - for (const line of range(6, { base: 38 })) { 36 - expect(uncoveredFileLines[line], `Line #${line}`).toBe(undefined) 37 - } 38 - }) 39 - 40 - function range(count: number, options: { base: number } = { base: 1 }) { 41 - return Array(count).fill(0).map((_, i) => options.base + i) 42 - }
-52
test/coverage-test/coverage-report-tests/istanbul.report.test.ts
··· 1 - /* 2 - * Istanbul coverage provider specific test cases 3 - */ 4 - 5 - import { expect, test } from 'vitest' 6 - import { readCoverageJson } from './utils' 7 - 8 - test('istanbul json report', async () => { 9 - const jsonReport = await readCoverageJson() 10 - 11 - // If this fails, you can use "npx live-server@1.2.1 ./coverage" to see coverage report 12 - expect(jsonReport).toMatchSnapshot() 13 - }) 14 - 15 - test('implicit else is included in branch count', async () => { 16 - const coverageMap = await readCoverageJson() 17 - 18 - const filename = '<process-cwd>/src/implicitElse.ts' 19 - const fileCoverage = coverageMap[filename] 20 - 21 - expect(fileCoverage.b).toHaveProperty('0') 22 - expect(fileCoverage.b['0']).toHaveLength(2) 23 - }) 24 - 25 - test('ignored code is excluded from the report', async () => { 26 - const functionName = 'ignoredFunction' 27 - const filename = '<process-cwd>/src/utils.ts' 28 - 29 - const coverageMap = await readCoverageJson() 30 - const fileCoverage = coverageMap[filename] 31 - 32 - // Function should not be included in report 33 - const functionCoverage = Object.values(fileCoverage.fnMap).find(fn => fn.name === functionName) 34 - expect(functionCoverage).toBe(undefined) 35 - 36 - // Function should still be found from the actual sources 37 - const utils = await import('../src/utils') 38 - expect(utils[functionName]).toBeTypeOf('function') 39 - }) 40 - 41 - test('tests with multiple suites are covered', async () => { 42 - const coverageMap = await readCoverageJson() 43 - 44 - const filename = '<process-cwd>/src/multi-suite.ts' 45 - const fileCoverage = coverageMap[filename] 46 - 47 - // Assert that all functions are covered 48 - expect(fileCoverage.f).toMatchObject({ 49 - 0: 1, 50 - 1: 1, 51 - }) 52 - })
-27
test/coverage-test/coverage-report-tests/merge-reports.test.ts
··· 1 - import { expect, test } from 'vitest' 2 - import libCoverage from 'istanbul-lib-coverage' 3 - 4 - import { readCoverageJson } from '../coverage-report-tests/utils' 5 - 6 - test('reports are merged', async () => { 7 - const json = await readCoverageJson('./coverage/coverage-final.json') 8 - const coverageMap = libCoverage.createCoverageMap(json as any) 9 - const files = coverageMap.files() 10 - 11 - // Two files were covered: 2/3 cases covered utils, 1/3 covered importEnv 12 - expect(files).toMatchInlineSnapshot(` 13 - [ 14 - "<process-cwd>/src/importEnv.ts", 15 - "<process-cwd>/src/utils.ts", 16 - ] 17 - `) 18 - 19 - const fileCoverage = coverageMap.fileCoverageFor('<process-cwd>/src/utils.ts') 20 - const lines = fileCoverage.getLineCoverage() 21 - 22 - // add() should be covered by one test file 23 - expect(lines[2]).toBe(1) 24 - 25 - // multiply() should be covered by two test files 26 - expect(lines[6]).toBe(2) 27 - })
-35
test/coverage-test/coverage-report-tests/utils.ts
··· 1 - import { readFileSync } from 'node:fs' 2 - import { normalize } from 'pathe' 3 - 4 - interface CoverageFinalJson { 5 - default: { 6 - [filename: string]: { 7 - path: string 8 - b: Record<string, number[]> 9 - f: Record<string, number> 10 - fnMap: Record<string, { name: string }> 11 - // ... and more unrelated keys 12 - } 13 - } 14 - } 15 - 16 - /** 17 - * Read JSON coverage report from file system. 18 - * Normalizes paths to keep contents consistent between OS's 19 - */ 20 - export async function readCoverageJson(name = './coverage/custom-json-report-name.json') { 21 - const jsonReport = JSON.parse(readFileSync(name, 'utf8')) as CoverageFinalJson 22 - 23 - const normalizedReport: CoverageFinalJson['default'] = {} 24 - 25 - for (const [filename, coverage] of Object.entries(jsonReport)) { 26 - coverage.path = normalizeFilename(coverage.path) 27 - normalizedReport[normalizeFilename(filename)] = coverage 28 - } 29 - 30 - return normalizedReport 31 - } 32 - 33 - export function normalizeFilename(filename: string) { 34 - return normalize(filename).replace(normalize(process.cwd()), '<process-cwd>') 35 - }
-44
test/coverage-test/coverage-report-tests/v8.report.test.ts
··· 1 - /* 2 - * V8 coverage provider specific test cases 3 - */ 4 - 5 - import { expect, test } from 'vitest' 6 - import { readCoverageJson } from './utils' 7 - 8 - test('v8 json report', async () => { 9 - const jsonReport = await readCoverageJson() 10 - 11 - // If this fails, you can use "npx live-server@1.2.1 ./coverage" to see coverage report 12 - expect(jsonReport).toMatchSnapshot() 13 - }) 14 - 15 - test('ignored code is marked as covered in the report', async () => { 16 - const functionName = 'ignoredFunction' 17 - const filename = '<process-cwd>/src/utils.ts' 18 - 19 - const coverageMap = await readCoverageJson() 20 - const fileCoverage = coverageMap[filename] 21 - 22 - const [functionKey] = Object.entries(fileCoverage.fnMap).find(([, fn]) => fn.name === functionName)! 23 - const functionCallCount = fileCoverage.f[functionKey] 24 - 25 - // v8-to-istanbul marks excluded lines as covered, instead of removing them from report completely 26 - expect(functionCallCount).toBe(1) 27 - 28 - // Function should still be found from the actual sources 29 - const utils = await import('../src/utils') 30 - expect(utils[functionName]).toBeTypeOf('function') 31 - }) 32 - 33 - test('tests with multiple suites are covered', async () => { 34 - const coverageMap = await readCoverageJson() 35 - 36 - const filename = '<process-cwd>/src/multi-suite.ts' 37 - const fileCoverage = coverageMap[filename] 38 - 39 - // Assert that all functions are covered 40 - expect(fileCoverage.f).toMatchObject({ 41 - 0: 1, 42 - 1: 1, 43 - }) 44 - })
+120
test/coverage-test/fixtures/custom-provider.ts
··· 1 + import { existsSync, mkdirSync, rmSync, writeFileSync } from 'node:fs' 2 + import { normalize, resolve, sep } from 'node:path' 3 + import type { AfterSuiteRunMeta, CoverageProvider, CoverageProviderModule, ReportContext, ResolvedCoverageOptions, Vitest } from 'vitest' 4 + 5 + const CustomCoverageProviderModule: CoverageProviderModule = { 6 + getProvider(): CoverageProvider { 7 + return new CustomCoverageProvider() 8 + }, 9 + 10 + takeCoverage() { 11 + // @ts-expect-error -- untyped 12 + globalThis.CUSTOM_PROVIDER_TAKE_COVERAGE = true 13 + 14 + // @ts-expect-error -- untyped 15 + if (!globalThis.CUSTOM_PROVIDER_START_COVERAGE) { 16 + throw new Error('takeCoverage was called before startCoverage!') 17 + } 18 + 19 + return { customCoverage: 'Coverage report passed from workers to main thread' } 20 + }, 21 + 22 + startCoverage() { 23 + // @ts-expect-error -- untyped 24 + globalThis.CUSTOM_PROVIDER_START_COVERAGE = true 25 + }, 26 + 27 + stopCoverage() { 28 + // @ts-expect-error -- untyped 29 + if (!globalThis.CUSTOM_PROVIDER_START_COVERAGE) { 30 + throw new Error('stopCoverage was called before startCoverage!') 31 + } 32 + 33 + // @ts-expect-error -- untyped 34 + if (!globalThis.CUSTOM_PROVIDER_TAKE_COVERAGE) { 35 + throw new Error('stopCoverage was called before takeCoverage!') 36 + } 37 + }, 38 + } 39 + 40 + /** 41 + * Provider that simply keeps track of the functions that were called 42 + */ 43 + class CustomCoverageProvider implements CoverageProvider { 44 + name = 'custom-coverage-provider' 45 + 46 + options!: ResolvedCoverageOptions 47 + calls: Set<string> = new Set() 48 + coverageReports: Set<string> = new Set() 49 + transformedFiles: Set<string> = new Set() 50 + 51 + initialize(ctx: Vitest) { 52 + this.options = ctx.config.coverage 53 + 54 + this.calls.add(`initialized ${ctx ? 'with' : 'without'} context`) 55 + } 56 + 57 + clean(force?: boolean) { 58 + this.calls.add(`clean ${force ? 'with' : 'without'} force`) 59 + } 60 + 61 + onAfterSuiteRun(meta: AfterSuiteRunMeta) { 62 + // Do not include coverage info here, as order of tests is not guaranteed 63 + this.calls.add('onAfterSuiteRun') 64 + 65 + // Keep coverage info separate from calls and ignore its order 66 + this.coverageReports.add(JSON.stringify({ 67 + ...meta, 68 + 69 + // Project name keeps changing so let's simply check that its present 70 + projectName: meta.projectName && typeof meta.projectName === 'string', 71 + })) 72 + } 73 + 74 + generateCoverage(_reportContext: ReportContext) { 75 + return {} 76 + } 77 + 78 + reportCoverage(coverage: unknown, reportContext?: ReportContext) { 79 + this.calls.add(`reportCoverage with ${JSON.stringify(reportContext)}`) 80 + 81 + const jsonReport = JSON.stringify({ 82 + calls: Array.from(this.calls.values()), 83 + coverageReports: Array.from(this.coverageReports.values()).sort(), 84 + transformedFiles: Array.from(this.transformedFiles.values()).sort(), 85 + }, null, 2) 86 + 87 + if (existsSync('./coverage')) { 88 + rmSync('./coverage', { maxRetries: 10, recursive: true }) 89 + } 90 + 91 + mkdirSync('./coverage') 92 + writeFileSync('./coverage/custom-coverage-provider-report.json', jsonReport, 'utf-8') 93 + } 94 + 95 + onFileTransform(code: string, id: string) { 96 + const filename = normalizeFilename(id).split('?')[0] 97 + 98 + if (/\/fixtures\/src\//.test(filename)) { 99 + this.transformedFiles.add(filename) 100 + } 101 + 102 + return { code } 103 + } 104 + 105 + resolveOptions(): ResolvedCoverageOptions { 106 + this.calls.add('resolveOptions') 107 + 108 + return this.options 109 + } 110 + } 111 + 112 + export default CustomCoverageProviderModule 113 + 114 + 115 + function normalizeFilename(filename: string) { 116 + return normalize(filename) 117 + .replace(normalize(process.cwd()), '<process-cwd>') 118 + .replace(normalize(resolve(process.cwd(), '../../')), '<project-root>') 119 + .replaceAll(sep, "/") 120 + }
+26
test/coverage-test/fixtures/custom-reporter.cjs
··· 1 + /* Istanbul uses `require`: https://github.com/istanbuljs/istanbuljs/blob/5584b50305a6a17d3573aea25c84e254d4a08b65/packages/istanbul-reports/index.js#L19 */ 2 + 3 + 'use strict' 4 + const { ReportBase } = require('istanbul-lib-report') 5 + 6 + module.exports = class CustomReporter extends ReportBase { 7 + constructor(opts) { 8 + super() 9 + 10 + if (!opts.file) { 11 + throw new Error('File is required as custom reporter parameter') 12 + } 13 + 14 + this.file = opts.file 15 + } 16 + 17 + onStart(root, context) { 18 + this.contentWriter = context.writer.writeFile(this.file) 19 + this.contentWriter.println('Start of custom coverage report') 20 + } 21 + 22 + onEnd() { 23 + this.contentWriter.println('End of custom coverage report') 24 + this.contentWriter.close() 25 + } 26 + }
+1
test/coverage-test/fixtures/setup.ts
··· 1 + console.log('Running setup in fixtures root')
-12
test/coverage-test/option-tests/allow-external.test.ts
··· 1 - import { expect, test } from 'vitest' 2 - 3 - import { multiply } from '../src/utils' 4 - import * as ExternalMath from '../../test-utils/fixtures/math' 5 - 6 - test('calling files outside project root', () => { 7 - expect(ExternalMath.sum(2, 3)).toBe(5) 8 - }) 9 - 10 - test('multiply - add some files to report', () => { 11 - expect(multiply(2, 3)).toBe(6) 12 - })
-6
test/coverage-test/option-tests/changed.test.ts
··· 1 - import { test } from 'vitest' 2 - import { run } from '../src/file-to-change' 3 - 4 - test('test case for changed file', () => { 5 - run() 6 - })
-7
test/coverage-test/option-tests/empty-lines.test.ts
··· 1 - import { expect, test } from 'vitest' 2 - 3 - import { add } from '../src/empty-lines' 4 - 5 - test('cover some lines', () => { 6 - expect(add(10, 20)).toBe(30) 7 - })
-8
test/coverage-test/option-tests/fixture.test.ts
··· 1 - // Generic test fixture to generate some coverage 2 - 3 - import { test } from 'vitest' 4 - import { add } from '../src/utils' 5 - 6 - test('cover some lines', () => { 7 - add(1, 2) 8 - })
-6
test/coverage-test/option-tests/merge-fixture-1.test.ts
··· 1 - import { test } from 'vitest' 2 - import { add } from '../src/utils' 3 - 4 - test('cover add', () => { 5 - add(1, 2) 6 - })
-6
test/coverage-test/option-tests/merge-fixture-2.test.ts
··· 1 - import { test } from 'vitest' 2 - import { multiply } from '../src/utils' 3 - 4 - test('cover multiply', () => { 5 - multiply(1, 2) 6 - })
-11
test/coverage-test/option-tests/merge-fixture-3.test.ts
··· 1 - import { test } from 'vitest' 2 - import { multiply } from '../src/utils' 3 - import { useImportEnv } from '../src/importEnv' 4 - 5 - test('cover multiply again', () => { 6 - multiply(1, 2) 7 - }) 8 - 9 - test('also cover another file', () => { 10 - useImportEnv() 11 - })
-9
test/coverage-test/option-tests/shard.test.ts
··· 1 - import { readdirSync } from 'node:fs' 2 - import { expect, test } from 'vitest' 3 - 4 - test('temporary directory is postfixed with --shard value', () => { 5 - const files = readdirSync('./coverage') 6 - 7 - expect(files).toContain('.tmp-1-4') 8 - expect(files).not.toContain('.tmp') 9 - })
-18
test/coverage-test/option-tests/threshold-100.test.ts
··· 1 - // eslint-disable-next-line ts/ban-ts-comment -- Type tests keep picking this file up and fails 2 - // @ts-nocheck 3 - 4 - import { assert, expect, test } from 'vitest' 5 - import { getWorkerState } from 'vitest/src/utils.js' 6 - 7 - test('thresholds.100 sets global thresholds to 100', () => { 8 - const state = getWorkerState() 9 - 10 - assert(state.config.coverage.provider === 'v8' || state.config.coverage.provider === 'istanbul') 11 - assert(state.config.coverage.thresholds !== undefined) 12 - 13 - expect(state.config.coverage.thresholds[100]).toBe(true) 14 - expect(state.config.coverage.thresholds.lines).toBe(100) 15 - expect(state.config.coverage.thresholds.branches).toBe(100) 16 - expect(state.config.coverage.thresholds.functions).toBe(100) 17 - expect(state.config.coverage.thresholds.statements).toBe(100) 18 - })
-162
test/coverage-test/option-tests/thresholds-auto-update.test.ts
··· 1 - import { parseModule } from 'magicast' 2 - import type { CoverageMap } from 'istanbul-lib-coverage' 3 - import { createCoverageSummary } from 'istanbul-lib-coverage' 4 - 5 - import { expect, test } from 'vitest' 6 - import { defineConfig } from 'vitest/config' 7 - import { BaseCoverageProvider } from 'vitest/coverage' 8 - 9 - const initialThresholds = { lines: 1, branches: 2, functions: 3, statements: 4 } 10 - const coveredThresholds = { lines: 50, branches: 60, functions: 70, statements: 80 } 11 - const initialConfig = JSON.stringify(defineConfig({ 12 - test: { 13 - coverage: { 14 - thresholds: initialThresholds, 15 - }, 16 - }, 17 - }), null, 2) 18 - 19 - test('updates thresholds on "export default {..}"', async () => { 20 - const config = parseModule(`export default ${initialConfig}`) 21 - 22 - const updatedConfig = await updateThresholds(config) 23 - 24 - expect(updatedConfig).toMatchInlineSnapshot(` 25 - "export default { 26 - "test": { 27 - "coverage": { 28 - "thresholds": { 29 - "lines": 50, 30 - "branches": 60, 31 - "functions": 70, 32 - "statements": 80 33 - } 34 - } 35 - } 36 - }" 37 - `) 38 - }) 39 - 40 - test('updates thresholds on "export default defineConfig({...})"', async () => { 41 - const config = parseModule(`export default defineConfig(${initialConfig})`) 42 - 43 - const updatedConfig = await updateThresholds(config) 44 - 45 - expect(updatedConfig).toMatchInlineSnapshot(` 46 - "export default defineConfig({ 47 - "test": { 48 - "coverage": { 49 - "thresholds": { 50 - "lines": 50, 51 - "branches": 60, 52 - "functions": 70, 53 - "statements": 80 54 - } 55 - } 56 - } 57 - })" 58 - `) 59 - }) 60 - 61 - test('updates thresholds on "export default defineConfig(() => ({...}))"', async () => { 62 - const config = parseModule(`export default defineConfig(() => (${initialConfig}))`) 63 - 64 - const updatedConfig = await updateThresholds(config) 65 - 66 - expect(updatedConfig).toMatchInlineSnapshot(` 67 - "export default defineConfig(() => ({ 68 - "test": { 69 - "coverage": { 70 - "thresholds": { 71 - "lines": 50, 72 - "branches": 60, 73 - "functions": 70, 74 - "statements": 80 75 - } 76 - } 77 - } 78 - }))" 79 - `) 80 - }) 81 - 82 - test('updates thresholds on "export default mergeConfig({...}, defineConfig({...}))"', async () => { 83 - const config = parseModule(`export default mergeConfig(baseConfig, defineConfig(${initialConfig}))`) 84 - 85 - const updatedConfig = await updateThresholds(config) 86 - 87 - expect(updatedConfig).toMatchInlineSnapshot(` 88 - "export default mergeConfig(baseConfig, defineConfig({ 89 - "test": { 90 - "coverage": { 91 - "thresholds": { 92 - "lines": 50, 93 - "branches": 60, 94 - "functions": 70, 95 - "statements": 80 96 - } 97 - } 98 - } 99 - }))" 100 - `) 101 - }) 102 - 103 - test('updates thresholds on "export default defineConfig(() => mergeConfig({...}, defineConfig({...})))"', async () => { 104 - const config = parseModule(`export default defineConfig((configEnv) => mergeConfig(baseConfig, defineConfig(${initialConfig})))`) 105 - 106 - const updatedConfig = await updateThresholds(config) 107 - 108 - expect(updatedConfig).toMatchInlineSnapshot(` 109 - "export default defineConfig((configEnv) => mergeConfig(baseConfig, defineConfig({ 110 - "test": { 111 - "coverage": { 112 - "thresholds": { 113 - "lines": 50, 114 - "branches": 60, 115 - "functions": 70, 116 - "statements": 80 117 - } 118 - } 119 - } 120 - })))" 121 - `) 122 - }) 123 - 124 - test('throws when configuration is too complex to analyze', async () => { 125 - const config = parseModule(` 126 - import config from "./some-path" 127 - export default config 128 - `) 129 - 130 - await expect(updateThresholds(config)).rejects.toThrowErrorMatchingInlineSnapshot(`[Error: Failed to update coverage thresholds. Configuration file is too complex.]`) 131 - }) 132 - 133 - async function updateThresholds(configurationFile: ReturnType<typeof parseModule>) { 134 - const summaryData = { total: 0, covered: 0, skipped: 0 } 135 - const thresholds = [{ 136 - name: 'global', 137 - thresholds: initialThresholds, 138 - coverageMap: { 139 - getCoverageSummary: () => createCoverageSummary({ 140 - lines: { pct: coveredThresholds.lines, ...summaryData }, 141 - statements: { pct: coveredThresholds.statements, ...summaryData }, 142 - branches: { pct: coveredThresholds.branches, ...summaryData }, 143 - functions: { pct: coveredThresholds.functions, ...summaryData }, 144 - }), 145 - } as CoverageMap, 146 - }] 147 - 148 - return new Promise((resolve, reject) => { 149 - const provider = new BaseCoverageProvider() 150 - 151 - try { 152 - provider.updateThresholds({ 153 - thresholds, 154 - configurationFile, 155 - onUpdate: () => resolve(configurationFile.generate().code), 156 - }) 157 - } 158 - catch (error) { 159 - reject(error) 160 - } 161 - }) 162 - }
-6
test/coverage-test/option-tests/thresholds.test.ts
··· 1 - import { test } from 'vitest' 2 - import { add } from '../src/utils' 3 - 4 - test('cover some lines, but not too much', () => { 5 - add(1, 2) 6 - })
-22
test/coverage-test/src/Defined.vue
··· 1 - <script setup lang="ts"> 2 - const defined = MY_CONSTANT 3 - 4 - /* eslint-disable no-console */ 5 - if (defined) { 6 - console.log('Covered condition') 7 - } 8 - else { 9 - console.log('Uncovered condition') 10 - } 11 - </script> 12 - 13 - <template> 14 - {{ defined }} 15 - </template> 16 - 17 - <!-- Style block triggers a specific condition where sourcemaps used to break randomly --> 18 - <style lang="css" scoped> 19 - body { 20 - background-color: #FFF; 21 - } 22 - </style>
-17
test/coverage-test/src/Hello.vue
··· 1 - <script setup lang="ts"> 2 - import { computed, ref } from 'vue' 3 - 4 - const props = defineProps<{ count: number }>() 5 - 6 - const times = ref(2) 7 - const result = computed(() => props.count * times.value) 8 - 9 - defineExpose(props) 10 - </script> 11 - 12 - <template> 13 - <div>{{ count }} x {{ times }} = {{ result }}</div> 14 - <button @click="times += 1"> 15 - x1 16 - </button> 17 - </template>
-2
test/coverage-test/src/another-setup.ts
··· 1 - // eslint-disable-next-line no-console 2 - console.log('Another Setup File')
-27
test/coverage-test/src/decorators.ts
··· 1 - // eslint-disable-next-line ts/ban-ts-comment -- so that typecheck doesn't include it 2 - // @ts-nocheck 3 - export class DecoratorsTester { 4 - method(@SomeDecorator parameter: Something) { 5 - if (parameter) { 6 - // Covered line 7 - noop(parameter) 8 - } 9 - 10 - if (parameter === 'uncovered') { 11 - // Uncovered line 12 - noop(parameter) 13 - } 14 - } 15 - } 16 - 17 - function SomeDecorator( 18 - _target: Object, 19 - _propertyKey: string | symbol, 20 - _parameterIndex: number, 21 - ) {} 22 - 23 - type Something = unknown 24 - 25 - function noop(..._args: unknown[]) { 26 - 27 - }
-51
test/coverage-test/src/dynamic-files.ts
··· 1 - import { existsSync, rmSync, writeFileSync } from 'node:fs' 2 - import { createRequire } from 'node:module' 3 - import { fileURLToPath } from 'node:url' 4 - 5 - export async function runDynamicFileESM() { 6 - const filename = fileURLToPath(new URL('./dynamic-file-esm.ignore.js', import.meta.url)) 7 - 8 - if (existsSync(filename)) { 9 - rmSync(filename) 10 - } 11 - 12 - writeFileSync(filename, ` 13 - // File created by coverage-test/src/dynamic-files.ts 14 - export function run() { 15 - return "Import works" 16 - } 17 - function uncovered() {} 18 - `.trim(), 'utf-8') 19 - 20 - const { run } = await import(filename) 21 - 22 - if (run() !== 'Import works') { 23 - throw new Error(`Failed to run ${filename}`) 24 - } 25 - 26 - rmSync(filename) 27 - } 28 - 29 - export async function runDynamicFileCJS() { 30 - const filename = fileURLToPath(new URL('./dynamic-file-cjs.ignore.cjs', import.meta.url)) 31 - 32 - if (existsSync(filename)) { 33 - rmSync(filename) 34 - } 35 - 36 - writeFileSync(filename, ` 37 - // File created by coverage-test/src/dynamic-files.ts 38 - module.exports.run = function run() { 39 - return "Import works" 40 - } 41 - function uncovered() {} 42 - `.trim(), 'utf-8') 43 - 44 - const { run } = createRequire(import.meta.url)(filename) 45 - 46 - if (run() !== 'Import works') { 47 - throw new Error(`Failed to run ${filename}`) 48 - } 49 - 50 - rmSync(filename) 51 - }
-29
test/coverage-test/src/empty-lines.ts
··· 1 - /* eslint-disable unused-imports/no-unused-vars -- intentional */ 2 - export function add(a: number, b: number) { 3 - /** 4 - * Multi 5 - * line 6 - * comment 7 - */ 8 - if (a === 2 && b === 3) { 9 - // This line should NOT be covered 10 - return 5 11 - } 12 - 13 - type TypescriptTypings = 1 | 2 14 - 15 - if (a === 1 && b === 1) { 16 - // This line should NOT be covered 17 - return 2 18 - } 19 - 20 - interface MoreCompileTimeCode { 21 - should: { 22 - be: { 23 - excluded: true 24 - } 25 - } 26 - } 27 - 28 - return a + b 29 - }
-7
test/coverage-test/src/file-to-change.ts
··· 1 - export function run() { 2 - return 'This file will be modified by test cases' 3 - } 4 - 5 - export function uncoveredFunction() { 6 - return 1 + 2 7 - }
-36
test/coverage-test/src/function-count.ts
··· 1 - /* 2 - * This file should have: 3 - * - 5 functions in total 4 - * - 3 covered functions 5 - * - 2 uncovered functions 6 - */ 7 - 8 - /* eslint-disable unused-imports/no-unused-vars */ 9 - 10 - // This function is covered 11 - function first() { 12 - return 1 13 - } 14 - 15 - first() 16 - 17 - // This function is covered 18 - export function second() { 19 - fifth() 20 - return 2 21 - } 22 - 23 - // This function is NOT covered 24 - export function third() { 25 - throw new Error('Do not call this function') 26 - } 27 - 28 - // This function is NOT covered 29 - function fourth() { 30 - return 4 31 - } 32 - 33 - // This function is covered 34 - function fifth() { 35 - return 5 36 - }
-9
test/coverage-test/src/implicitElse.ts
··· 1 - export function implicitElse(condition: boolean) { 2 - let a = 1 3 - 4 - if (condition) { 5 - a = 2 6 - } 7 - 8 - return a 9 - }
-3
test/coverage-test/src/importEnv.ts
··· 1 - export function useImportEnv() { 2 - return import.meta.env.SOME_VARIABLE == null 3 - }
-7
test/coverage-test/src/index.mts
··· 1 - import { add, multiply, sqrt } from './utils' 2 - 3 - export * from './utils' 4 - 5 - export function pythagoras(a: number, b: number) { 6 - return sqrt(add(multiply(a, a), multiply(b, b))) 7 - }
-1
test/coverage-test/src/load-outside-vite.cjs
··· 1 - module.exports = function noop() {}
-31
test/coverage-test/src/multi-environment.ts
··· 1 - /** 2 - * The variable below is modified by custom Vite plugin 3 - */ 4 - export const padding = 'default-padding' 5 - 6 - export function sum(a: number, b: number) { 7 - /* 8 - * These if-branches should show correctly on coverage report. 9 - * Otherwise source maps are off. 10 - */ 11 - if (a === 8 && b === 9) { 12 - // This is not covered by any test 13 - return 17 14 - } 15 - // Comment 16 - else if (a === 2 && b === 2) { 17 - // This is covered by SSR test 18 - return 4 19 - } 20 - else if (a === 11 && b === 22) { 21 - // This is not covered by any test 22 - return 33 23 - } 24 - else if (a === 10 && b === 23) { 25 - // This is covered by Web test 26 - return 33 27 - } 28 - 29 - // This is covered by SSR and Web test, should show 2x hits 30 - return a + b 31 - }
-9
test/coverage-test/src/multi-suite.ts
··· 1 - export default { 2 - func1(data: any[]) { 3 - return data 4 - }, 5 - 6 - func2(data: any[]) { 7 - return data 8 - }, 9 - }
-21
test/coverage-test/src/original.ts
··· 1 - export const hello = (arg?: unknown) => { 2 - if (arg) { 3 - // Uncovered 4 - noop(); 5 - } 6 - 7 - // Covered 8 - noop(); 9 - 10 - if (arg === 3) { 11 - // Uncovered 12 - noop(); 13 - } 14 - 15 - if (arg === undefined) { 16 - // Covered 17 - noop(); 18 - } 19 - }; 20 - 21 - function noop() {}
-5
test/coverage-test/src/should-be-excluded-from-report.test-d.ts
··· 1 - // This file should be excluded from coverage report 2 - 3 - export function uncoveredFile() { 4 - return 0 5 - }
-1
test/coverage-test/src/transpiled.d.ts
··· 1 - export * from './original'
-18
test/coverage-test/src/transpiled.js
··· 1 - export var hello = function (arg) { 2 - if (arg) { 3 - // Uncovered 4 - noop(); 5 - } 6 - // Covered 7 - noop(); 8 - if (arg === 3) { 9 - // Uncovered 10 - noop(); 11 - } 12 - if (arg === undefined) { 13 - // Covered 14 - noop(); 15 - } 16 - }; 17 - function noop() { } 18 - //# sourceMappingURL=transpiled.js.map
-13
test/coverage-test/src/transpiled.js.map
··· 1 - { 2 - "version": 3, 3 - "file": "transpiled.js", 4 - "sourceRoot": "", 5 - "sources": [ 6 - "./original.ts" 7 - ], 8 - "names": [], 9 - "mappings": "AAAA,MAAM,CAAC,IAAM,KAAK,GAAG,UAAC,GAAa;IACjC,IAAI,GAAG,EAAE,CAAC;QACR,YAAY;QACZ,IAAI,EAAE,CAAC;IACT,CAAC;IAED,UAAU;IACV,IAAI,EAAE,CAAC;IAEP,IAAI,GAAG,KAAK,CAAC,EAAE,CAAC;QACd,YAAY;QACZ,IAAI,EAAE,CAAC;IACT,CAAC;IAED,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QACtB,UAAU;QACV,IAAI,EAAE,CAAC;IACT,CAAC;AACH,CAAC,CAAC;AAEF,SAAS,IAAI,KAAI,CAAC", 10 - "sourcesContent": [ 11 - "export const hello = (arg?: unknown) => {\n if (arg) {\n // Uncovered\n noop();\n }\n\n // Covered\n noop();\n\n if (arg === 3) {\n // Uncovered\n noop();\n }\n\n if (arg === undefined) {\n // Covered\n noop();\n }\n};\n\nfunction noop() {}\n" 12 - ] 13 - }
-3
test/coverage-test/src/types.ts
··· 1 - export type First = 'This' | 'file' | 'should' 2 - 3 - export type Second = 'be' | 'excluded' | 'from' | 'report'
-47
test/coverage-test/src/untested-file.ts
··· 1 - /* 2 - * Some top level comment which adds some padding. This helps us see 3 - * if sourcemaps are off. 4 - */ 5 - 6 - /* eslint-disable unused-imports/no-unused-vars -- intentional */ 7 - 8 - export default function untestedFile() { 9 - return 'This file should end up in report when {"all": true} is given' 10 - } 11 - 12 - function add(a: number, b: number) { 13 - // This line should NOT be covered 14 - return a + b 15 - } 16 - 17 - type TypescriptTypings = 1 | 2 18 - 19 - function multiply(a: number, b: number) { 20 - // This line should NOT be covered 21 - return a * b 22 - } 23 - 24 - export function math(a: number, b: number, operator: '*' | '+') { 25 - interface MoreCompileTimeCode { 26 - should: { 27 - be: { 28 - excluded: true 29 - } 30 - } 31 - } 32 - 33 - if (operator === '*') { 34 - // This line should NOT be covered 35 - return multiply(a, b) 36 - } 37 - 38 - /* v8 ignore start */ 39 - if (operator === '+') { 40 - // This line should be excluded 41 - return add(a, b) 42 - } 43 - /* v8 ignore stop */ 44 - 45 - // This line should NOT be covered 46 - throw new Error('Unsupported operator') 47 - }
-30
test/coverage-test/src/utils.ts
··· 1 - export function add(a: number, b: number) { 2 - return a + b 3 - } 4 - 5 - export function multiply(a: number, b: number) { 6 - return a * b 7 - } 8 - 9 - export function divide(a: number, b: number) { 10 - // this should not be covered 11 - return a / b 12 - } 13 - 14 - export function sqrt(a: number) { 15 - if (a < 0) { 16 - return Number.NaN // This should not be covered 17 - } 18 - return Math.sqrt(a) 19 - } 20 - 21 - export function run() { 22 - // this should not be covered 23 - divide(1, 1) 24 - } 25 - 26 - /* v8 ignore next 4 */ 27 - /* istanbul ignore next -- @preserve */ 28 - export function ignoredFunction() { 29 - throw new Error('Test files should not call this function!') 30 - }
-6
test/coverage-test/src/vue.shim.d.ts
··· 1 - declare module '*.vue' { 2 - import type { DefineComponent } from 'vue' 3 - 4 - const component: DefineComponent<{}, {}, any> 5 - export default component 6 - }
+44
test/coverage-test/test/all.test.ts
··· 1 + import { expect } from 'vitest' 2 + import { readCoverageMap, runVitest, test } from '../utils' 3 + 4 + test('{ all: true } includes uncovered files', async () => { 5 + await runVitest({ 6 + include: ['fixtures/test/**'], 7 + exclude: ['**/virtual-files-**'], 8 + coverage: { 9 + include: ['fixtures/src/**'], 10 + all: true, 11 + reporter: 'json', 12 + }, 13 + }) 14 + 15 + const coverageMap = await readCoverageMap() 16 + const files = coverageMap.files() 17 + 18 + expect(files).toContain('<process-cwd>/fixtures/src/untested-file.ts') 19 + expect(files.length).toBeGreaterThanOrEqual(3) 20 + 21 + // Directories starting with dot should be excluded, check for ".should-be-excluded-from-coverage/excluded-from-coverage.ts" 22 + expect(files.find(file => file.includes('excluded-from-coverage'))).toBeFalsy() 23 + }) 24 + 25 + test('{ all: false } excludes uncovered files', async () => { 26 + await runVitest({ 27 + include: ['fixtures/test/**'], 28 + exclude: ['**/virtual-files-**'], 29 + coverage: { 30 + include: ['fixtures/src/**'], 31 + all: false, 32 + reporter: 'json', 33 + }, 34 + }) 35 + 36 + const coverageMap = await readCoverageMap() 37 + const files = coverageMap.files() 38 + 39 + expect(files.find(file => file.includes('untested-file'))).toBeFalsy() 40 + expect(files.length).toBeGreaterThanOrEqual(3) 41 + 42 + // Directories starting with dot should be excluded, check for ".should-be-excluded-from-coverage/excluded-from-coverage.ts" 43 + expect(files.find(file => file.includes('excluded-from-coverage'))).toBeFalsy() 44 + })
+42
test/coverage-test/test/allow-external.test.ts
··· 1 + import { expect } from 'vitest' 2 + import { coverageTest, normalizeURL, readCoverageMap, runVitest, test } from '../utils' 3 + import { multiply } from '../fixtures/src/math' 4 + import * as ExternalMath from '../../test-utils/fixtures/math' 5 + 6 + test('{ allowExternal: true } includes files outside project root', async () => { 7 + await runVitest({ 8 + include: [normalizeURL(import.meta.url)], 9 + coverage: { allowExternal: true, reporter: 'json' }, 10 + }) 11 + const coverageMap = await readCoverageMap() 12 + const files = coverageMap.files() 13 + 14 + // File outside project root 15 + expect(files).toContain('<project-root>/test/test-utils/fixtures/math.ts') 16 + 17 + // Files inside project root should always be included 18 + expect(files).toContain('<process-cwd>/fixtures/src/math.ts') 19 + }) 20 + 21 + test('{ allowExternal: false } excludes files outside project root', async () => { 22 + await runVitest({ 23 + include: [normalizeURL(import.meta.url)], 24 + coverage: { allowExternal: false, reporter: 'json' }, 25 + }) 26 + const coverageMap = await readCoverageMap() 27 + const files = coverageMap.files() 28 + 29 + // File outside project root 30 + expect(files.find(file => file.includes('test-utils/fixtures/math.ts'))).toBeFalsy() 31 + 32 + // Files inside project root should always be included 33 + expect(files).toContain('<process-cwd>/fixtures/src/math.ts') 34 + }) 35 + 36 + coverageTest('calling files outside project root', () => { 37 + expect(ExternalMath.sum(2, 3)).toBe(5) 38 + }) 39 + 40 + coverageTest('multiply - add some files to report', () => { 41 + expect(multiply(2, 3)).toBe(6) 42 + })
+56
test/coverage-test/test/changed.test.ts
··· 1 + import { readFileSync, rmSync, writeFileSync } from 'node:fs' 2 + import { resolve } from 'node:path' 3 + import { afterAll, beforeAll, expect } from 'vitest' 4 + import { readCoverageMap, runVitest, test } from '../utils' 5 + 6 + const FILE_TO_CHANGE = resolve('./fixtures/src/file-to-change.ts') 7 + const NEW_UNCOVERED_FILE = resolve('./fixtures/src/new-uncovered-file.ts') 8 + 9 + beforeAll(() => { 10 + let content = readFileSync(FILE_TO_CHANGE, 'utf8') 11 + content = content.replace('This file will be modified by test cases', 'Changed!') 12 + writeFileSync(FILE_TO_CHANGE, content, 'utf8') 13 + 14 + writeFileSync(NEW_UNCOVERED_FILE, ` 15 + // This file is not covered by any tests but should be picked by --changed 16 + export default function helloworld() { 17 + return 'Hello world' 18 + } 19 + `.trim(), 'utf8') 20 + }) 21 + 22 + afterAll(() => { 23 + let content = readFileSync(FILE_TO_CHANGE, 'utf8') 24 + content = content.replace('Changed!', 'This file will be modified by test cases') 25 + writeFileSync(FILE_TO_CHANGE, content, 'utf8') 26 + rmSync(NEW_UNCOVERED_FILE) 27 + }) 28 + 29 + test('{ changed: "HEAD" }', async () => { 30 + await runVitest({ 31 + include: ['fixtures/test/**'], 32 + changed: 'HEAD', 33 + coverage: { 34 + include: ['fixtures/src/**'], 35 + reporter: 'json', 36 + all: true, 37 + }, 38 + }) 39 + 40 + const coverageMap = await readCoverageMap() 41 + 42 + // Note that this test may fail if you have new files in "vitest/test/coverage/src" 43 + // and have not yet committed those 44 + expect(coverageMap.files()).toMatchInlineSnapshot(` 45 + [ 46 + "<process-cwd>/fixtures/src/file-to-change.ts", 47 + "<process-cwd>/fixtures/src/new-uncovered-file.ts", 48 + ] 49 + `) 50 + 51 + const uncoveredFile = coverageMap.fileCoverageFor('<process-cwd>/fixtures/src/new-uncovered-file.ts').toSummary() 52 + expect(uncoveredFile.lines.pct).toBe(0) 53 + 54 + const changedFile = coverageMap.fileCoverageFor('<process-cwd>/fixtures/src/file-to-change.ts').toSummary() 55 + expect(changedFile.lines.pct).toBeGreaterThanOrEqual(50) 56 + }, !!process.env.ECOSYSTEM_CI)
-94
test/coverage-test/test/coverage.test.ts
··· 1 - import { describe, expect, test } from 'vitest' 2 - 3 - // @ts-expect-error -- untyped virtual file provided by custom plugin 4 - import virtualFile1 from 'virtual:vitest-custom-virtual-file-1' 5 - 6 - import { implicitElse } from '../src/implicitElse' 7 - import { useImportEnv } from '../src/importEnv' 8 - import { second } from '../src/function-count' 9 - import MultiSuite from '../src/multi-suite' 10 - import { DecoratorsTester } from '../src/decorators' 11 - 12 - // @ts-expect-error -- untyped virtual file provided by custom plugin 13 - import virtualFile2 from '\0vitest-custom-virtual-file-2' 14 - 15 - // Browser mode crashes with dynamic files. Enable this when browser mode works. 16 - // To keep istanbul report consistent between browser and node, skip dynamic tests when istanbul is used. 17 - const provider = globalThis.process?.env.COVERAGE_PROVIDER 18 - const skipDynamicFiles = '__vitest_browser__' in globalThis || provider === 'istanbul' || !provider 19 - 20 - const { pythagoras } = await (() => { 21 - if ('__vitest_browser__' in globalThis) { 22 - // TODO: remove workaround after vite 4.3.2 23 - // @ts-expect-error extension is not specified 24 - return import('../src/index') 25 - } 26 - const dynamicImport = '../src/index.mjs' 27 - return import(dynamicImport) 28 - })() 29 - 30 - test('Math.sqrt()', async () => { 31 - expect(pythagoras(3, 4)).toBe(5) 32 - }) 33 - 34 - test('implicit else', () => { 35 - expect(implicitElse(true)).toBe(2) 36 - }) 37 - 38 - test('import meta env', () => { 39 - expect(useImportEnv()).toBe(true) 40 - }) 41 - 42 - test('cover function counts', () => { 43 - expect(second()).toBe(2) 44 - }) 45 - 46 - describe('Multiple test suites', () => { 47 - describe('func1()', () => { 48 - test('func1', () => { 49 - const data = ['a', 'b'] 50 - const val = MultiSuite.func1(data) 51 - expect(val).toEqual(data) 52 - }) 53 - }) 54 - describe('func2()', () => { 55 - test('func2', () => { 56 - const data = ['c', 'd'] 57 - const val = MultiSuite.func2(data) 58 - expect(val).toEqual(data) 59 - }) 60 - }) 61 - }) 62 - 63 - test.skipIf(skipDynamicFiles)('run dynamic ESM file', async () => { 64 - const { runDynamicFileESM } = await import('../src/dynamic-files') 65 - await runDynamicFileESM() 66 - }) 67 - 68 - test.skipIf(skipDynamicFiles)('run dynamic CJS file', async () => { 69 - const { runDynamicFileCJS } = await import('../src/dynamic-files') 70 - await runDynamicFileCJS() 71 - }) 72 - 73 - test('virtual file imports', () => { 74 - expect(virtualFile1).toBe('This file should be excluded from coverage report #1') 75 - expect(virtualFile2).toBe('This file should be excluded from coverage report #2') 76 - }) 77 - 78 - test('decorators', () => { 79 - new DecoratorsTester().method('cover line') 80 - }) 81 - 82 - // Istanbul fails to follow source maps on windows 83 - test.runIf(provider === 'v8' || provider === 'custom')('pre-transpiled code with source maps to original', async () => { 84 - const transpiled = await import('../src/transpiled.js') 85 - 86 - transpiled.hello() 87 - }) 88 - 89 - test.runIf(provider === 'v8' || provider === 'custom')('file loaded outside Vite, #5639', async () => { 90 - const { Module: { createRequire } } = await import('node:module') 91 - 92 - const noop = createRequire(import.meta.url)('../src/load-outside-vite.cjs') 93 - expect(noop).toBeTypeOf('function') 94 - })
+30
test/coverage-test/test/custom-provider.custom.test.ts
··· 1 + import { readFileSync } from 'node:fs' 2 + import { expect } from 'vitest' 3 + import { runVitest, test } from '../utils' 4 + 5 + test('custom provider', async () => { 6 + await runVitest({ 7 + include: ['fixtures/test/math.test.ts', 'fixtures/test/even.test.ts'], 8 + }) 9 + 10 + const report = readFileSync('./coverage/custom-coverage-provider-report.json', 'utf-8') 11 + 12 + expect(report).toMatchInlineSnapshot(` 13 + "{ 14 + "calls": [ 15 + "initialized with context", 16 + "resolveOptions", 17 + "clean with force", 18 + "onAfterSuiteRun", 19 + "reportCoverage with {\\"allTestsRun\\":true}" 20 + ], 21 + "coverageReports": [ 22 + "{\\"coverage\\":{\\"customCoverage\\":\\"Coverage report passed from workers to main thread\\"},\\"transformMode\\":\\"ssr\\",\\"projectName\\":\\"\\"}" 23 + ], 24 + "transformedFiles": [ 25 + "<process-cwd>/fixtures/src/even.ts", 26 + "<process-cwd>/fixtures/src/math.ts" 27 + ] 28 + }" 29 + `) 30 + })
+32
test/coverage-test/test/custom-reporter.test.ts
··· 1 + import { readFileSync, readdirSync } from 'node:fs' 2 + import { resolve } from 'node:path' 3 + import { expect } from 'vitest' 4 + import { coverageTest, normalizeURL, runVitest, test } from '../utils' 5 + import { sum } from '../fixtures/src/math' 6 + 7 + test('custom reporter', async () => { 8 + await runVitest({ 9 + include: [normalizeURL(import.meta.url)], 10 + coverage: { 11 + reporter: [ 12 + [resolve('fixtures/custom-reporter.cjs'), { file: 'custom-reporter-output.md' }], 13 + ], 14 + }, 15 + }) 16 + 17 + const coveragePath = resolve('./coverage') 18 + const files = readdirSync(coveragePath) 19 + 20 + expect(files).toContain('custom-reporter-output.md') 21 + 22 + const content = readFileSync(resolve(coveragePath, 'custom-reporter-output.md'), 'utf-8') 23 + expect(content).toMatchInlineSnapshot(` 24 + "Start of custom coverage report 25 + End of custom coverage report 26 + " 27 + `) 28 + }) 29 + 30 + coverageTest('cover some lines', () => { 31 + expect(sum(2, 5)).toBe(7) 32 + })
+36
test/coverage-test/test/decorators.test.ts
··· 1 + import { expect } from 'vitest' 2 + import { coverageTest, isV8Provider, normalizeURL, readCoverageMap, runVitest, test } from '../utils' 3 + import { DecoratorsTester } from '../fixtures/src/decorators' 4 + 5 + test('decorators generated metadata is ignored', async () => { 6 + await runVitest({ 7 + include: [normalizeURL(import.meta.url)], 8 + config: 'fixtures/configs/vitest.config.decorators.ts', 9 + coverage: { reporter: 'json', all: false }, 10 + }) 11 + 12 + const coverageMap = await readCoverageMap() 13 + const fileCoverage = coverageMap.fileCoverageFor('<process-cwd>/fixtures/src/decorators.ts') 14 + const lineCoverage = fileCoverage.getLineCoverage() 15 + const branchCoverage = fileCoverage.getBranchCoverageByLine() 16 + 17 + // Decorator should not be uncovered - on V8 this is marked as covered, on Istanbul it's excluded from report 18 + if (isV8Provider()) { 19 + expect(lineCoverage['4']).toBe(1) 20 + expect(branchCoverage['4'].coverage).toBe(100) 21 + } 22 + else { 23 + expect(lineCoverage['4']).toBeUndefined() 24 + expect(branchCoverage['4']).toBeUndefined() 25 + } 26 + 27 + // Covered branch should be marked correctly 28 + expect(lineCoverage['7']).toBe(1) 29 + 30 + // Uncovered branch should be marked correctly 31 + expect(lineCoverage['12']).toBe(0) 32 + }) 33 + 34 + coverageTest('cover decorators', () => { 35 + new DecoratorsTester().method('cover line') 36 + })
+30
test/coverage-test/test/dynamic-files.test.ts
··· 1 + import { expect } from 'vitest' 2 + import { coverageTest, isV8Provider, normalizeURL, readCoverageMap, runVitest, test } from '../utils' 3 + import { runDynamicFileCJS, runDynamicFileESM } from '../fixtures/src/dynamic-files' 4 + 5 + test('does not crash when files are created and removed during test run (#3657)', async () => { 6 + await runVitest({ 7 + include: [normalizeURL(import.meta.url)], 8 + coverage: { reporter: 'json' }, 9 + }) 10 + 11 + const coverageMap = await readCoverageMap() 12 + const files = coverageMap.files() 13 + 14 + expect(files).toContain('<process-cwd>/fixtures/src/dynamic-files.ts') 15 + expect(files).toContain('<process-cwd>/fixtures/src/dynamic-file-esm.ignore.js') 16 + 17 + // V8 provider is able to capture CJS as well as it's detected on runtime. 18 + // Istanbul requires the file to be either processed by Vite, or be present on file system when coverage.all kicks in 19 + if (isV8Provider()) { 20 + expect(files).toContain('<process-cwd>/fixtures/src/dynamic-file-cjs.ignore.cjs') 21 + } 22 + }) 23 + 24 + coverageTest('run dynamic ESM file', async () => { 25 + await expect(runDynamicFileESM()).resolves.toBe('Done') 26 + }) 27 + 28 + coverageTest('run dynamic CJS file', async () => { 29 + await expect(runDynamicFileCJS()).resolves.toBe('Done') 30 + })
+23
test/coverage-test/test/empty-coverage-directory.test.ts
··· 1 + import { existsSync, readdirSync } from 'node:fs' 2 + import { expect } from 'vitest' 3 + import { coverageTest, normalizeURL, runVitest, test } from '../utils' 4 + import { sum } from '../fixtures/src/math' 5 + 6 + test('empty coverage directory is cleaned after tests', async () => { 7 + await runVitest({ 8 + include: [normalizeURL(import.meta.url)], 9 + coverage: { reporter: 'text', all: false }, 10 + }) 11 + 12 + if (existsSync('./coverage')) { 13 + if (readdirSync('./coverage').length !== 0) { 14 + throw new Error('Test case expected coverage directory to be empty') 15 + } 16 + 17 + throw new Error('Empty coverage directory was not cleaned') 18 + } 19 + }) 20 + 21 + coverageTest('cover some lines', () => { 22 + expect(sum(2, 3)).toBe(5) 23 + })
+197
test/coverage-test/test/empty-lines.v8.test.ts
··· 1 + import { beforeAll, expect } from 'vitest' 2 + import { coverageTest, describe, normalizeURL, readCoverageMap, runVitest, test } from '../utils' 3 + import { add } from '../fixtures/src/empty-lines' 4 + 5 + type CoveredLine = 1 6 + type UncoveredLine = 0 7 + type IgnoredLine = undefined 8 + 9 + // Key is 1-based line number 10 + type LineCoverage = Record<number, CoveredLine | UncoveredLine | IgnoredLine> 11 + 12 + describe('include empty lines', () => { 13 + let coveredFileLines: LineCoverage 14 + let uncoveredFileLines: LineCoverage 15 + let files: string[] 16 + 17 + beforeAll(async () => { 18 + await runVitest({ 19 + include: [normalizeURL(import.meta.url)], 20 + coverage: { 21 + reporter: 'json', 22 + ignoreEmptyLines: false, 23 + include: [ 24 + '**/fixtures/src/empty-lines.ts', 25 + '**/fixtures/src/untested-file.ts', 26 + '**/fixtures/src/types-only.ts', 27 + ], 28 + }, 29 + }) 30 + 31 + ;({ coveredFileLines, uncoveredFileLines, files } = await readCoverage()) 32 + }) 33 + 34 + test('file containing only types is ignored', () => { 35 + expect(files).toMatchInlineSnapshot(` 36 + [ 37 + "<process-cwd>/fixtures/src/empty-lines.ts", 38 + "<process-cwd>/fixtures/src/untested-file.ts", 39 + ] 40 + `) 41 + }) 42 + 43 + test('lines are included', async () => { 44 + for (const line of range(29)) { 45 + expect(coveredFileLines[line], `Line #${line}`).not.toBe(undefined) 46 + expect(coveredFileLines[line], `Line #${line}`).toBeTypeOf('number') 47 + } 48 + 49 + for (const lines of [range(37), range(4, { base: 44 })]) { 50 + for (const line of lines) { 51 + expect(uncoveredFileLines[line], `Line #${line}`).not.toBe(undefined) 52 + expect(uncoveredFileLines[line], `Line #${line}`).toBeTypeOf('number') 53 + } 54 + } 55 + }) 56 + 57 + test('lines with ignore hints are ignored', () => { 58 + for (const line of range(6, { base: 38 })) { 59 + expect(uncoveredFileLines[line], `Line #${line}`).toBe(undefined) 60 + } 61 + }) 62 + }) 63 + 64 + describe('ignore empty lines', () => { 65 + let coveredFileLines: LineCoverage 66 + let uncoveredFileLines: LineCoverage 67 + let files: string[] 68 + 69 + beforeAll(async () => { 70 + await runVitest({ 71 + include: [normalizeURL(import.meta.url)], 72 + coverage: { 73 + reporter: 'json', 74 + include: [ 75 + '**/fixtures/src/empty-lines.ts', 76 + '**/fixtures/src/untested-file.ts', 77 + '**/fixtures/src/types-only.ts', 78 + ], 79 + }, 80 + }) 81 + 82 + ;({ coveredFileLines, uncoveredFileLines, files } = await readCoverage()) 83 + }) 84 + 85 + test('file containing only types is ignored', () => { 86 + expect(files).toMatchInlineSnapshot(` 87 + [ 88 + "<process-cwd>/fixtures/src/empty-lines.ts", 89 + "<process-cwd>/fixtures/src/untested-file.ts", 90 + ] 91 + `) 92 + }) 93 + 94 + test('empty lines are ignored', async () => { 95 + expect(coveredFileLines[12]).toBe(undefined) 96 + expect(coveredFileLines[14]).toBe(undefined) 97 + expect(coveredFileLines[19]).toBe(undefined) 98 + expect(coveredFileLines[27]).toBe(undefined) 99 + expect(coveredFileLines[30]).toBe(undefined) 100 + 101 + expect(uncoveredFileLines[5]).toBe(undefined) 102 + expect(uncoveredFileLines[7]).toBe(undefined) 103 + }) 104 + 105 + test('comments are ignored', async () => { 106 + expect(coveredFileLines[1]).toBe(undefined) 107 + expect(coveredFileLines[3]).toBe(undefined) 108 + expect(coveredFileLines[4]).toBe(undefined) 109 + expect(coveredFileLines[5]).toBe(undefined) 110 + expect(coveredFileLines[6]).toBe(undefined) 111 + expect(coveredFileLines[7]).toBe(undefined) 112 + expect(coveredFileLines[9]).toBe(undefined) 113 + expect(coveredFileLines[16]).toBe(undefined) 114 + 115 + expect(uncoveredFileLines[1]).toBe(undefined) 116 + expect(uncoveredFileLines[2]).toBe(undefined) 117 + expect(uncoveredFileLines[3]).toBe(undefined) 118 + expect(uncoveredFileLines[4]).toBe(undefined) 119 + expect(uncoveredFileLines[6]).toBe(undefined) 120 + expect(uncoveredFileLines[13]).toBe(undefined) 121 + expect(uncoveredFileLines[20]).toBe(undefined) 122 + expect(uncoveredFileLines[34]).toBe(undefined) 123 + expect(uncoveredFileLines[45]).toBe(undefined) 124 + }) 125 + 126 + test('ignore hints are ignored', () => { 127 + expect(uncoveredFileLines[38]).toBe(undefined) 128 + expect(uncoveredFileLines[39]).toBe(undefined) 129 + expect(uncoveredFileLines[40]).toBe(undefined) 130 + expect(uncoveredFileLines[41]).toBe(undefined) 131 + expect(uncoveredFileLines[42]).toBe(undefined) 132 + expect(uncoveredFileLines[43]).toBe(undefined) 133 + }) 134 + 135 + test('typescript types are ignored', () => { 136 + expect(coveredFileLines[13]).toBe(undefined) 137 + expect(coveredFileLines[20]).toBe(undefined) 138 + expect(coveredFileLines[21]).toBe(undefined) 139 + expect(coveredFileLines[22]).toBe(undefined) 140 + expect(coveredFileLines[23]).toBe(undefined) 141 + expect(coveredFileLines[24]).toBe(undefined) 142 + expect(coveredFileLines[25]).toBe(undefined) 143 + expect(coveredFileLines[26]).toBe(undefined) 144 + 145 + expect(uncoveredFileLines[17]).toBe(undefined) 146 + expect(uncoveredFileLines[25]).toBe(undefined) 147 + expect(uncoveredFileLines[26]).toBe(undefined) 148 + expect(uncoveredFileLines[27]).toBe(undefined) 149 + expect(uncoveredFileLines[28]).toBe(undefined) 150 + expect(uncoveredFileLines[29]).toBe(undefined) 151 + expect(uncoveredFileLines[30]).toBe(undefined) 152 + expect(uncoveredFileLines[31]).toBe(undefined) 153 + }) 154 + 155 + test('runtime code is not ignored', () => { 156 + // Covered 157 + expect(coveredFileLines[2]).toBe(1) 158 + expect(coveredFileLines[8]).toBe(1) 159 + expect(coveredFileLines[15]).toBe(1) 160 + expect(coveredFileLines[28]).toBe(1) 161 + 162 + // Uncovered 163 + expect(coveredFileLines[10]).toBe(0) 164 + expect(coveredFileLines[17]).toBe(0) 165 + 166 + // Uncovered 167 + expect(uncoveredFileLines[8]).toBe(0) 168 + expect(uncoveredFileLines[9]).toBe(0) 169 + expect(uncoveredFileLines[10]).toBe(0) 170 + expect(uncoveredFileLines[12]).toBe(0) 171 + expect(uncoveredFileLines[14]).toBe(0) 172 + expect(uncoveredFileLines[19]).toBe(0) 173 + expect(uncoveredFileLines[21]).toBe(0) 174 + expect(uncoveredFileLines[24]).toBe(0) 175 + expect(uncoveredFileLines[33]).toBe(0) 176 + expect(uncoveredFileLines[35]).toBe(0) 177 + expect(uncoveredFileLines[46]).toBe(0) 178 + }) 179 + }) 180 + 181 + coverageTest('cover some lines', () => { 182 + expect(add(10, 20)).toBe(30) 183 + }) 184 + 185 + async function readCoverage() { 186 + const coverageMap = await readCoverageMap() 187 + const files = coverageMap.files() 188 + 189 + const coveredFileLines = coverageMap.fileCoverageFor('<process-cwd>/fixtures/src/empty-lines.ts').getLineCoverage() as LineCoverage 190 + const uncoveredFileLines = coverageMap.fileCoverageFor('<process-cwd>/fixtures/src/untested-file.ts').getLineCoverage() as LineCoverage 191 + 192 + return { coveredFileLines, uncoveredFileLines, files } 193 + } 194 + 195 + function range(count: number, options: { base: number } = { base: 1 }) { 196 + return Array(count).fill(0).map((_, i) => options.base + i) 197 + }
+81
test/coverage-test/test/file-outside-vite.test.ts
··· 1 + import { createRequire } from 'node:module' 2 + import { expect } from 'vitest' 3 + import { coverageTest, isV8Provider, normalizeURL, readCoverageMap, runVitest, test } from '../utils' 4 + 5 + test('does not crash when file outside Vite is loaded (#5639)', async () => { 6 + await runVitest({ 7 + include: [normalizeURL(import.meta.url)], 8 + coverage: { reporter: 'json' }, 9 + }) 10 + 11 + const coverageMap = await readCoverageMap() 12 + const fileCoverage = coverageMap.fileCoverageFor('<process-cwd>/fixtures/src/load-outside-vite.cjs') 13 + const summary = fileCoverage.toSummary() 14 + 15 + if (isV8Provider()) { 16 + expect(summary).toMatchInlineSnapshot(` 17 + { 18 + "branches": { 19 + "covered": 0, 20 + "pct": 100, 21 + "skipped": 0, 22 + "total": 0, 23 + }, 24 + "functions": { 25 + "covered": 0, 26 + "pct": 0, 27 + "skipped": 0, 28 + "total": 1, 29 + }, 30 + "lines": { 31 + "covered": 1, 32 + "pct": 100, 33 + "skipped": 0, 34 + "total": 1, 35 + }, 36 + "statements": { 37 + "covered": 1, 38 + "pct": 100, 39 + "skipped": 0, 40 + "total": 1, 41 + }, 42 + } 43 + `) 44 + } 45 + else { 46 + expect(summary).toMatchInlineSnapshot(` 47 + { 48 + "branches": { 49 + "covered": 0, 50 + "pct": 100, 51 + "skipped": 0, 52 + "total": 0, 53 + }, 54 + "functions": { 55 + "covered": 0, 56 + "pct": 0, 57 + "skipped": 0, 58 + "total": 1, 59 + }, 60 + "lines": { 61 + "covered": 0, 62 + "pct": 0, 63 + "skipped": 0, 64 + "total": 1, 65 + }, 66 + "statements": { 67 + "covered": 0, 68 + "pct": 0, 69 + "skipped": 0, 70 + "total": 1, 71 + }, 72 + } 73 + `) 74 + } 75 + }) 76 + 77 + coverageTest('load file using require so it\'s not intercepted by Vite', () => { 78 + const noop = createRequire(import.meta.url)('../fixtures/src/load-outside-vite.cjs') 79 + 80 + expect(noop).toBeTypeOf('function') 81 + })
+30
test/coverage-test/test/ignore-hints.test.ts
··· 1 + /* 2 + * Ignore hints are implemented by 3rd party packages but there's 3 + * Vitest related logic (esbuild) that makes them work. 4 + */ 5 + 6 + import { expect } from 'vitest' 7 + import { isV8Provider, readCoverageMap, runVitest, test } from '../utils' 8 + 9 + test('ignore hints work', async () => { 10 + await runVitest({ 11 + include: ['fixtures/test/ignore-hints-fixture.test.ts'], 12 + coverage: { reporter: 'json', all: false }, 13 + }) 14 + 15 + const coverageMap = await readCoverageMap() 16 + const fileCoverage = coverageMap.fileCoverageFor('<process-cwd>/fixtures/src/ignore-hints.ts') 17 + const lines = fileCoverage.getLineCoverage() 18 + 19 + expect(lines[8]).toBeGreaterThanOrEqual(1) 20 + expect(lines[12]).toBeGreaterThanOrEqual(1) 21 + 22 + if (isV8Provider()) { 23 + expect(lines[15]).toBeUndefined() 24 + expect(lines[18]).toBeGreaterThanOrEqual(1) 25 + } 26 + else { 27 + expect(lines[15]).toBeGreaterThanOrEqual(1) 28 + expect(lines[18]).toBeUndefined() 29 + } 30 + })
+20
test/coverage-test/test/implicit-else.istanbul.test.ts
··· 1 + import { expect } from 'vitest' 2 + import { coverageTest, normalizeURL, readCoverageMap, runVitest, test } from '../utils' 3 + import { implicitElse } from '../fixtures/src/implicit-else' 4 + 5 + test('implicit else is included in branch count', async () => { 6 + await runVitest({ 7 + include: [normalizeURL(import.meta.url)], 8 + coverage: { reporter: 'json', all: false }, 9 + }) 10 + 11 + const coverageMap = await readCoverageMap() 12 + const fileCoverage = coverageMap.fileCoverageFor('<process-cwd>/fixtures/src/implicit-else.ts') 13 + 14 + expect(fileCoverage.b).toHaveProperty('0') 15 + expect(fileCoverage.b['0']).toHaveLength(2) 16 + }) 17 + 18 + coverageTest('cover if branch', () => { 19 + expect(implicitElse(true)).toBe(2) 20 + })
+23
test/coverage-test/test/import-meta-env.test.ts
··· 1 + import { expect } from 'vitest' 2 + import { coverageTest, normalizeURL, readCoverageMap, runVitest, test } from '../utils' 3 + import { useImportEnv } from '../fixtures/src/import-meta-env' 4 + 5 + test('file using import.meta.env is included in report (#2332)', async () => { 6 + await runVitest( 7 + { 8 + include: [normalizeURL(import.meta.url)], 9 + coverage: { reporter: 'json' }, 10 + env: { SOME_VARIABLE: 'some variable set here' }, 11 + }, 12 + ) 13 + 14 + const coverageMap = await readCoverageMap() 15 + const fileCoverage = coverageMap.fileCoverageFor('<process-cwd>/fixtures/src/import-meta-env.ts') 16 + const lines = fileCoverage.getLineCoverage() 17 + 18 + expect(lines[3]).toBe(1) 19 + }) 20 + 21 + coverageTest('cover file that uses import.meta.env', () => { 22 + expect(useImportEnv()).toBe('some variable set here') 23 + })
+50
test/coverage-test/test/merge-reports.test.ts
··· 1 + import { expect } from 'vitest' 2 + import { readCoverageMap, runVitest, test } from '../utils' 3 + 4 + test('--merge-reports', async () => { 5 + for (const index of [1, 2, 3]) { 6 + await runVitest({ 7 + name: `generate #${index} blob report`, 8 + include: ['fixtures/test/merge-fixture-*.test.ts'], 9 + reporters: 'blob', 10 + shard: `${index}/3`, 11 + coverage: { all: false }, 12 + }) 13 + } 14 + 15 + await runVitest({ 16 + name: 'merge blob reports', 17 + // Pass default value - this option is publicly only available via CLI so it's a bit hacky usage here 18 + mergeReports: '.vitest-reports', 19 + coverage: { 20 + reporter: 'json', 21 + all: false, 22 + }, 23 + }) 24 + 25 + const coverageMap = await readCoverageMap() 26 + const files = coverageMap.files() 27 + 28 + // Two files were covered: 3/3 cases covered math.ts, 1/3 covered even.ts 29 + expect(files).toMatchInlineSnapshot(` 30 + [ 31 + "<process-cwd>/fixtures/src/even.ts", 32 + "<process-cwd>/fixtures/src/math.ts", 33 + ] 34 + `) 35 + 36 + const mathCoverage = coverageMap.fileCoverageFor('<process-cwd>/fixtures/src/math.ts') 37 + const mathLines = mathCoverage.getLineCoverage() 38 + 39 + // sum() should be covered by one test file 40 + expect(mathLines[2]).toBe(1) 41 + 42 + // multiply() should be covered by two test files 43 + expect(mathLines[10]).toBe(2) 44 + 45 + const evenCoverage = coverageMap.fileCoverageFor('<process-cwd>/fixtures/src/even.ts') 46 + const evenLines = evenCoverage.getLineCoverage() 47 + 48 + // isEven() should be covered by one test file 49 + expect(evenLines[2]).toBe(1) 50 + })
+14
test/coverage-test/test/mocking-in-js-file.test.ts
··· 1 + import { expect } from 'vitest' 2 + import { runVitest, test } from '../utils' 3 + 4 + test('mocking in JS test file should not crash source map lookup (#3514)', async () => { 5 + const { exitCode } = await runVitest({ 6 + include: ['fixtures/test/mocking-in-js-file.test.js'], 7 + coverage: { 8 + reporter: 'json', 9 + all: false, 10 + }, 11 + }) 12 + 13 + expect(exitCode).toBe(0) 14 + })
+30
test/coverage-test/test/multi-environment.test.ts
··· 1 + import { expect } from 'vitest' 2 + import { readCoverageMap, runVitest, test } from '../utils' 3 + 4 + test('{ all: true } includes uncovered files', async () => { 5 + await runVitest({ 6 + include: ['fixtures/test/multi-environment-fixture-**'], 7 + config: 'fixtures/configs/vitest.config.multi-transform.ts', 8 + coverage: { all: false, reporter: 'json' }, 9 + }) 10 + 11 + const coverageMap = await readCoverageMap() 12 + 13 + const fileCoverage = coverageMap.fileCoverageFor('<process-cwd>/fixtures/src/multi-environment.ts') 14 + const lineCoverage = fileCoverage.getLineCoverage() 15 + 16 + // Condition not covered by any test 17 + expect(lineCoverage[13]).toBe(0) 18 + 19 + // Condition covered by SSR test but not by Web 20 + expect(lineCoverage[18]).toBe(1) 21 + 22 + // Condition not covered by any test 23 + expect(lineCoverage[22]).toBe(0) 24 + 25 + // Condition covered by Web test but not by SSR 26 + expect(lineCoverage[26]).toBe(1) 27 + 28 + // Condition covered by both tests 29 + expect(lineCoverage[30]).toBe(2) 30 + })
+18
test/coverage-test/test/multi-suite.test.ts
··· 1 + import { expect } from 'vitest' 2 + import { readCoverageMap, runVitest, test } from '../utils' 3 + 4 + test('tests with multiple suites are covered (#3514)', async () => { 5 + await runVitest({ 6 + include: ['fixtures/test/multi-suite-fixture.test.ts'], 7 + coverage: { reporter: 'json', all: false }, 8 + }) 9 + 10 + const coverageMap = await readCoverageMap() 11 + const fileCoverage = coverageMap.fileCoverageFor('<process-cwd>/fixtures/src/multi-suite.ts') 12 + 13 + // Assert that all functions are covered 14 + expect(fileCoverage.f).toMatchObject({ 15 + 0: 1, 16 + 1: 1, 17 + }) 18 + })
+5
test/coverage-test/test/multi-transform.test.ts
··· 1 + import { test } from '../utils' 2 + 3 + test('files transformed with multiple transform modes work (#3251)', async () => { 4 + // TODO 5 + })
-10
test/coverage-test/test/no-esbuild-transform.test.js
··· 1 - import { expect, test, vi } from 'vitest' 2 - import { add } from '../src/utils' 3 - 4 - vi.mock('../src/utils', async () => ({ 5 - add: vi.fn().mockReturnValue('mocked'), 6 - })) 7 - 8 - test('mocking in Javascript test should not break sourcemaps', () => { 9 - expect(add(1, 2)).toBe('mocked') 10 - })
+32
test/coverage-test/test/pre-transpiled-source.test.ts
··· 1 + import libCoverage from 'istanbul-lib-coverage' 2 + import { expect } from 'vitest' 3 + import { coverageTest, isV8Provider, normalizeURL, readCoverageJson, runVitest, test } from '../utils' 4 + import * as transpiled from '../fixtures/src/pre-transpiled/transpiled.js' 5 + 6 + test('pre-transpiled code with source maps to original (#5341)', async () => { 7 + await runVitest({ 8 + include: [normalizeURL(import.meta.url)], 9 + coverage: { 10 + include: ['fixtures/src/**'], 11 + reporter: 'json', 12 + all: false, 13 + }, 14 + }) 15 + 16 + const coverageJson = await readCoverageJson() 17 + const coverageMap = libCoverage.createCoverageMap(coverageJson) 18 + const files = coverageMap.files() 19 + 20 + expect(files).toContain('<process-cwd>/fixtures/src/pre-transpiled/original.ts') 21 + expect(files.find(file => file.includes('transpiled.js'))).toBeFalsy() 22 + expect(files.find(file => file.includes('transpiled.js.map'))).toBeFalsy() 23 + expect(files.find(file => file.includes('transpiled.ts'))).toBeFalsy() 24 + expect(files.find(file => file.includes('transpiled.d.ts'))).toBeFalsy() 25 + 26 + expect(JSON.stringify(coverageJson, null, 2)).toMatchFileSnapshot(`__snapshots__/pre-transpiled-${isV8Provider() ? 'v8' : 'istanbul'}.snapshot.json`) 27 + }) 28 + 29 + coverageTest('run pre-transpiled sources', () => { 30 + expect(transpiled.hello).toBeTypeOf('function') 31 + expect(transpiled.hello()).toBeUndefined() 32 + })
+67
test/coverage-test/test/reporters.test.ts
··· 1 + import { readdirSync } from 'node:fs' 2 + import { expect } from 'vitest' 3 + import { runVitest, test } from '../utils' 4 + 5 + const include = ['fixtures/test/math.test.ts', 'fixtures/test/even.test.ts'] 6 + 7 + test('reporter as string', async () => { 8 + await runVitest({ 9 + include, 10 + coverage: { 11 + reporter: 'json', 12 + all: false, 13 + }, 14 + }) 15 + 16 + const files = readdirSync('./coverage') 17 + expect(files).toContain('coverage-final.json') 18 + }) 19 + 20 + test('reporter as list of strings', async () => { 21 + await runVitest({ 22 + include, 23 + coverage: { 24 + reporter: ['json', 'lcov'], 25 + all: false, 26 + }, 27 + }) 28 + 29 + const files = readdirSync('./coverage') 30 + expect(files).toContain('coverage-final.json') 31 + expect(files).toContain('lcov.info') 32 + expect(files).toContain('lcov-report') 33 + }) 34 + 35 + test('reporter as list of lists', async () => { 36 + await runVitest({ 37 + include, 38 + coverage: { 39 + reporter: [['json'], ['text', { file: 'custom-text-report' }]], 40 + all: false, 41 + }, 42 + }) 43 + 44 + const files = readdirSync('./coverage') 45 + expect(files).toContain('coverage-final.json') 46 + expect(files).toContain('custom-text-report') 47 + }) 48 + 49 + test('all reporter variants mixed', async () => { 50 + await runVitest({ 51 + include, 52 + coverage: { 53 + reporter: [ 54 + 'json', 55 + ['lcov'], 56 + ['text', { file: 'custom-text-report' }], 57 + ], 58 + all: false, 59 + }, 60 + }) 61 + 62 + const files = readdirSync('./coverage') 63 + expect(files).toContain('coverage-final.json') 64 + expect(files).toContain('lcov.info') 65 + expect(files).toContain('lcov-report') 66 + expect(files).toContain('custom-text-report') 67 + })
+20
test/coverage-test/test/results-snapshot.test.ts
··· 1 + import { expect } from 'vitest' 2 + import { isV8Provider, readCoverageJson, runVitest, test } from '../utils' 3 + 4 + test('coverage results matches snapshot', async () => { 5 + await runVitest({ 6 + include: ['fixtures/test/math.test.ts', 'fixtures/test/even.test.ts'], 7 + coverage: { 8 + reporter: 'json', 9 + include: [ 10 + 'fixtures/src/math.ts', 11 + 'fixtures/src/even.ts', 12 + 'fixtures/src/untested-file.ts', 13 + ], 14 + }, 15 + }) 16 + 17 + const coverageJson = await readCoverageJson() 18 + 19 + expect(JSON.stringify(coverageJson, null, 2)).toMatchFileSnapshot(`__snapshots__/results-${isV8Provider() ? 'v8' : 'istanbul'}.snapshot.json`) 20 + })
+34
test/coverage-test/test/setup-files.test.ts
··· 1 + import { resolve } from 'node:path' 2 + import { expect } from 'vitest' 3 + import { readCoverageMap, runVitest, test } from '../utils' 4 + 5 + test('tests with multiple suites are covered (#3514)', async () => { 6 + const { stdout } = await runVitest({ 7 + include: ['fixtures/test/math.test.ts'], 8 + setupFiles: [ 9 + // Full absolute path 10 + resolve('fixtures/setup.ts'), 11 + // Relative path 12 + 'fixtures/src/another-setup.ts', 13 + ], 14 + coverage: { 15 + include: ['fixtures/**'], 16 + reporter: 'json', 17 + }, 18 + }) 19 + 20 + // Setup files should have run 21 + expect(stdout).toContain('Running setup in fixtures root') 22 + expect(stdout).toContain('Running another setup in fixtures src') 23 + 24 + const coverageMap = await readCoverageMap() 25 + const files = coverageMap.files() 26 + 27 + // Setup files should be excluded from report 28 + expect(files.find(file => file.includes('setup.ts'))).toBeFalsy() 29 + 30 + // Some valid coverage should be reported 31 + const fileCoverage = coverageMap.fileCoverageFor('<process-cwd>/fixtures/src/math.ts') 32 + expect(fileCoverage.toSummary().functions.covered).toBe(1) 33 + expect(fileCoverage.toSummary().functions.pct).toBeLessThanOrEqual(25) 34 + })
+17
test/coverage-test/test/shard.test.ts
··· 1 + import { readdirSync } from 'node:fs' 2 + import { expect } from 'vitest' 3 + import { coverageTest, normalizeURL, runVitest, test } from '../utils' 4 + 5 + test('{ shard: 1/4 }', async () => { 6 + await runVitest({ 7 + include: [normalizeURL(import.meta.url)], 8 + shard: '1/4', 9 + }) 10 + }) 11 + 12 + coverageTest('temporary directory is postfixed with --shard value', () => { 13 + const files = readdirSync('./coverage') 14 + 15 + expect(files).toContain('.tmp-1-4') 16 + expect(files).not.toContain('.tmp') 17 + })
-9
test/coverage-test/test/ssr.test.ts
··· 1 - // @vitest-environment node 2 - 3 - import { expect, test } from 'vitest' 4 - import { sum } from '../src/multi-environment' 5 - 6 - test('runs on server', () => { 7 - expect(sum(2, 2)).toBe(4) 8 - expect(sum(100, 200)).toBe(300) 9 - })
+22
test/coverage-test/test/temporary-files.test.ts
··· 1 + import { readdirSync } from 'node:fs' 2 + import { resolve } from 'node:path' 3 + import { expect } from 'vitest' 4 + import { runVitest, test } from '../utils' 5 + 6 + test('temporary files are removed after test', async () => { 7 + await runVitest({ 8 + include: ['fixtures/test/math.test.ts'], 9 + coverage: { reporter: 'json' }, 10 + }) 11 + 12 + const coveragePath = resolve('./coverage') 13 + const files = readdirSync(coveragePath) 14 + 15 + expect(files).not.toContain('.tmp') 16 + 17 + expect(files).toMatchInlineSnapshot(` 18 + [ 19 + "coverage-final.json", 20 + ] 21 + `) 22 + })
+20
test/coverage-test/test/test-reporter-conflicts.test.ts
··· 1 + import { resolve } from 'node:path' 2 + import { readdirSync } from 'node:fs' 3 + import { expect } from 'vitest' 4 + import { runVitest, test } from '../utils' 5 + 6 + test('coverage provider does not conflict with built-in reporter\'s outputFile (#3330)', async () => { 7 + await runVitest({ 8 + include: ['fixtures/test/math.test.ts'], 9 + coverage: { reporter: ['html'], all: false }, 10 + reporters: ['default', 'junit'], 11 + outputFile: { junit: 'coverage/junit.xml' }, 12 + }) 13 + 14 + const coveragePath = resolve('./coverage') 15 + const files = readdirSync(coveragePath) 16 + 17 + expect(files).toContain('index.html') 18 + expect(files).toContain('junit.xml') 19 + expect(files).toContain('math.ts.html') 20 + })
+23
test/coverage-test/test/threshold-100.test.ts
··· 1 + import { assert, expect } from 'vitest' 2 + import { getWorkerState } from 'vitest/src/utils.js' 3 + import { coverageTest, normalizeURL, runVitest, test } from '../utils' 4 + 5 + test('{ threshold: { 100: true }}', async () => { 6 + await runVitest({ 7 + include: [normalizeURL(import.meta.url)], 8 + coverage: { thresholds: { 100: true } }, 9 + }, { throwOnError: false }) 10 + }) 11 + 12 + coverageTest('thresholds.100 sets global thresholds to 100', () => { 13 + const state = getWorkerState() 14 + 15 + assert(state.config.coverage.provider === 'v8' || state.config.coverage.provider === 'istanbul') 16 + assert(state.config.coverage.thresholds !== undefined) 17 + 18 + expect(state.config.coverage.thresholds[100]).toBe(true) 19 + expect(state.config.coverage.thresholds.lines).toBe(100) 20 + expect(state.config.coverage.thresholds.branches).toBe(100) 21 + expect(state.config.coverage.thresholds.functions).toBe(100) 22 + expect(state.config.coverage.thresholds.statements).toBe(100) 23 + })
+105
test/coverage-test/test/threshold-auto-update.test.ts
··· 1 + import { readFileSync, writeFileSync } from 'node:fs' 2 + import { expect, onTestFinished } from 'vitest' 3 + import { isV8Provider, runVitest, test } from '../utils' 4 + 5 + const config = 'fixtures/configs/vitest.config.thresholds-auto-update.ts' 6 + 7 + test('thresholds.autoUpdate updates thresholds', async () => { 8 + const original = readConfig() 9 + onTestFinished(() => writeFileSync(config, original)) 10 + 11 + expect(original).toMatchInlineSnapshot(` 12 + "import { defineConfig } from 'vitest/config' 13 + 14 + export default defineConfig({ 15 + test: { 16 + coverage: { 17 + thresholds: { 18 + autoUpdate: true, 19 + 20 + // Global ones 21 + lines: 0.1, 22 + functions: 0.2, 23 + branches: 0.3, 24 + statements: 0.4, 25 + 26 + '**/src/math.ts': { 27 + branches: 0.1, 28 + functions: 0.2, 29 + lines: 0.3, 30 + statements: 0.4 31 + } 32 + } 33 + } 34 + }, 35 + }) 36 + " 37 + `) 38 + 39 + await runVitest({ 40 + include: ['fixtures/test/math.test.ts', 'fixtures/test/even.test.ts'], 41 + coverage: { all: false }, 42 + config, 43 + }, { throwOnError: false }) 44 + 45 + if (isV8Provider()) { 46 + expect(readConfig()).toMatchInlineSnapshot(` 47 + "import { defineConfig } from 'vitest/config' 48 + 49 + export default defineConfig({ 50 + test: { 51 + coverage: { 52 + thresholds: { 53 + autoUpdate: true, 54 + 55 + // Global ones 56 + lines: 66.66, 57 + functions: 50, 58 + branches: 100, 59 + statements: 66.66, 60 + 61 + '**/src/math.ts': { 62 + branches: 100, 63 + functions: 25, 64 + lines: 50, 65 + statements: 50 66 + } 67 + } 68 + } 69 + }, 70 + })" 71 + `) 72 + } 73 + else { 74 + expect(readConfig()).toMatchInlineSnapshot(` 75 + "import { defineConfig } from 'vitest/config' 76 + 77 + export default defineConfig({ 78 + test: { 79 + coverage: { 80 + thresholds: { 81 + autoUpdate: true, 82 + 83 + // Global ones 84 + lines: 50, 85 + functions: 50, 86 + branches: 100, 87 + statements: 50, 88 + 89 + '**/src/math.ts': { 90 + branches: 100, 91 + functions: 25, 92 + lines: 25, 93 + statements: 25 94 + } 95 + } 96 + } 97 + }, 98 + })" 99 + `) 100 + } 101 + }) 102 + 103 + function readConfig() { 104 + return readFileSync(config, 'utf8') 105 + }
+162
test/coverage-test/test/threshold-auto-update.unit.test.ts
··· 1 + import { parseModule } from 'magicast' 2 + import type { CoverageMap } from 'istanbul-lib-coverage' 3 + import { createCoverageSummary } from 'istanbul-lib-coverage' 4 + 5 + import { expect, test } from 'vitest' 6 + import { defineConfig } from 'vitest/config' 7 + import { BaseCoverageProvider } from 'vitest/coverage' 8 + 9 + const initialThresholds = { lines: 1, branches: 2, functions: 3, statements: 4 } 10 + const coveredThresholds = { lines: 50, branches: 60, functions: 70, statements: 80 } 11 + const initialConfig = JSON.stringify(defineConfig({ 12 + test: { 13 + coverage: { 14 + thresholds: initialThresholds, 15 + }, 16 + }, 17 + }), null, 2) 18 + 19 + test('updates thresholds on "export default {..}"', async () => { 20 + const config = parseModule(`export default ${initialConfig}`) 21 + 22 + const updatedConfig = await updateThresholds(config) 23 + 24 + expect(updatedConfig).toMatchInlineSnapshot(` 25 + "export default { 26 + "test": { 27 + "coverage": { 28 + "thresholds": { 29 + "lines": 50, 30 + "branches": 60, 31 + "functions": 70, 32 + "statements": 80 33 + } 34 + } 35 + } 36 + }" 37 + `) 38 + }) 39 + 40 + test('updates thresholds on "export default defineConfig({...})"', async () => { 41 + const config = parseModule(`export default defineConfig(${initialConfig})`) 42 + 43 + const updatedConfig = await updateThresholds(config) 44 + 45 + expect(updatedConfig).toMatchInlineSnapshot(` 46 + "export default defineConfig({ 47 + "test": { 48 + "coverage": { 49 + "thresholds": { 50 + "lines": 50, 51 + "branches": 60, 52 + "functions": 70, 53 + "statements": 80 54 + } 55 + } 56 + } 57 + })" 58 + `) 59 + }) 60 + 61 + test('updates thresholds on "export default defineConfig(() => ({...}))"', async () => { 62 + const config = parseModule(`export default defineConfig(() => (${initialConfig}))`) 63 + 64 + const updatedConfig = await updateThresholds(config) 65 + 66 + expect(updatedConfig).toMatchInlineSnapshot(` 67 + "export default defineConfig(() => ({ 68 + "test": { 69 + "coverage": { 70 + "thresholds": { 71 + "lines": 50, 72 + "branches": 60, 73 + "functions": 70, 74 + "statements": 80 75 + } 76 + } 77 + } 78 + }))" 79 + `) 80 + }) 81 + 82 + test('updates thresholds on "export default mergeConfig({...}, defineConfig({...}))"', async () => { 83 + const config = parseModule(`export default mergeConfig(baseConfig, defineConfig(${initialConfig}))`) 84 + 85 + const updatedConfig = await updateThresholds(config) 86 + 87 + expect(updatedConfig).toMatchInlineSnapshot(` 88 + "export default mergeConfig(baseConfig, defineConfig({ 89 + "test": { 90 + "coverage": { 91 + "thresholds": { 92 + "lines": 50, 93 + "branches": 60, 94 + "functions": 70, 95 + "statements": 80 96 + } 97 + } 98 + } 99 + }))" 100 + `) 101 + }) 102 + 103 + test('updates thresholds on "export default defineConfig(() => mergeConfig({...}, defineConfig({...})))"', async () => { 104 + const config = parseModule(`export default defineConfig((configEnv) => mergeConfig(baseConfig, defineConfig(${initialConfig})))`) 105 + 106 + const updatedConfig = await updateThresholds(config) 107 + 108 + expect(updatedConfig).toMatchInlineSnapshot(` 109 + "export default defineConfig((configEnv) => mergeConfig(baseConfig, defineConfig({ 110 + "test": { 111 + "coverage": { 112 + "thresholds": { 113 + "lines": 50, 114 + "branches": 60, 115 + "functions": 70, 116 + "statements": 80 117 + } 118 + } 119 + } 120 + })))" 121 + `) 122 + }) 123 + 124 + test('throws when configuration is too complex to analyze', async () => { 125 + const config = parseModule(` 126 + import config from "./some-path" 127 + export default config 128 + `) 129 + 130 + await expect(updateThresholds(config)).rejects.toThrowErrorMatchingInlineSnapshot(`[Error: Failed to update coverage thresholds. Configuration file is too complex.]`) 131 + }) 132 + 133 + async function updateThresholds(configurationFile: ReturnType<typeof parseModule>) { 134 + const summaryData = { total: 0, covered: 0, skipped: 0 } 135 + const thresholds = [{ 136 + name: 'global', 137 + thresholds: initialThresholds, 138 + coverageMap: { 139 + getCoverageSummary: () => createCoverageSummary({ 140 + lines: { pct: coveredThresholds.lines, ...summaryData }, 141 + statements: { pct: coveredThresholds.statements, ...summaryData }, 142 + branches: { pct: coveredThresholds.branches, ...summaryData }, 143 + functions: { pct: coveredThresholds.functions, ...summaryData }, 144 + }), 145 + } as CoverageMap, 146 + }] 147 + 148 + return new Promise((resolve, reject) => { 149 + const provider = new BaseCoverageProvider() 150 + 151 + try { 152 + provider.updateThresholds({ 153 + thresholds, 154 + configurationFile, 155 + onUpdate: () => resolve(configurationFile.generate().code), 156 + }) 157 + } 158 + catch (error) { 159 + reject(error) 160 + } 161 + }) 162 + }
+33
test/coverage-test/test/threshold-failure.test.ts
··· 1 + import { expect } from 'vitest' 2 + import { coverageTest, isV8Provider, normalizeURL, runVitest, test } from '../utils' 3 + import { sum } from '../fixtures/src/math' 4 + 5 + test('failing thresholds', async () => { 6 + const { exitCode, stderr } = await runVitest({ 7 + include: [normalizeURL(import.meta.url)], 8 + coverage: { 9 + all: false, 10 + include: ['**/fixtures/src/math.ts'], 11 + thresholds: { 12 + '**/fixtures/src/math.ts': { 13 + branches: 100, 14 + functions: 100, 15 + lines: 100, 16 + statements: 100, 17 + }, 18 + }, 19 + }, 20 + }, { throwOnError: false }) 21 + 22 + const lines = isV8Provider() ? '50%' : '25%' 23 + const statements = isV8Provider() ? '50%' : '25%' 24 + 25 + expect(exitCode).toBe(1) 26 + expect(stderr).toContain(`ERROR: Coverage for lines (${lines}) does not meet "**/fixtures/src/math.ts" threshold (100%)`) 27 + expect(stderr).toContain(`ERROR: Coverage for statements (${statements}) does not meet "**/fixtures/src/math.ts" threshold (100%)`) 28 + expect(stderr).toContain('ERROR: Coverage for functions (25%) does not meet "**/fixtures/src/math.ts" threshold (100%)') 29 + }) 30 + 31 + coverageTest('cover some lines, but not too much', () => { 32 + expect(sum(1, 2)).toBe(3) 33 + })
+29
test/coverage-test/test/virtual-files.test.ts
··· 1 + import { expect } from 'vitest' 2 + import { readCoverageMap, runVitest, test } from '../utils' 3 + 4 + test('virtual files should be excluded', async () => { 5 + const { stdout } = await runVitest({ 6 + include: ['fixtures/test/virtual-files-fixture.test.ts'], 7 + coverage: { reporter: 'json' }, 8 + config: 'fixtures/configs/vitest.config.virtual-files.ts', 9 + }) 10 + 11 + expect(stdout).toContain('virtual-files-fixture.test.ts') 12 + expect(stdout).toContain('verify virtual files work') 13 + 14 + const coverageMap = await readCoverageMap() 15 + const files = coverageMap.files() 16 + 17 + expect(files.length).toBeGreaterThan(0) 18 + 19 + for (const file of files) { 20 + expect(file).not.toContain('virtual:') 21 + 22 + // Vitest in node 23 + expect(file).not.toContain('__x00__') 24 + expect(file).not.toContain('\0') 25 + 26 + // Vitest browser 27 + expect(file).not.toContain('\x00') 28 + } 29 + })
+90 -36
test/coverage-test/test/vue.test.ts
··· 1 - /** 2 - * @vitest-environment happy-dom 3 - */ 1 + import { resolve } from 'node:path' 2 + import { readdirSync } from 'node:fs' 3 + import { beforeAll, expect } from 'vitest' 4 + import { isV8Provider, readCoverageMap, runVitest, test } from '../utils' 4 5 5 - import { expect, test } from 'vitest' 6 - import { mount } from '@vue/test-utils' 7 - import Hello from '../src/Hello.vue' 8 - import Defined from '../src/Defined.vue' 9 - import { CounterVue } from '../src/Counter' 10 - 11 - test('vue 3 coverage', async () => { 12 - expect(Hello).toBeTruthy() 13 - 14 - const wrapper = mount(Hello, { 15 - props: { 16 - count: 4, 17 - }, 6 + beforeAll(async () => { 7 + await runVitest({ 8 + include: ['fixtures/test/vue-fixture.test.ts'], 9 + coverage: { reporter: ['json', 'html'], all: false }, 18 10 }) 19 - 20 - expect(wrapper.text()).toContain('4 x 2 = 8') 21 - expect(wrapper.html()).toMatchSnapshot() 22 - 23 - await wrapper.get('button').trigger('click') 24 - 25 - expect(wrapper.text()).toContain('4 x 3 = 12') 26 - 27 - await wrapper.get('button').trigger('click') 28 - 29 - expect(wrapper.text()).toContain('4 x 4 = 16') 30 11 }) 31 12 32 - test('define package in vm', () => { 33 - expect(Defined).toBeTruthy() 13 + test('files should not contain query parameters', () => { 14 + const coveragePath = resolve('./coverage/Vue/Counter/') 15 + const files = readdirSync(coveragePath) 34 16 35 - const wrapper = mount(Defined) 36 - 37 - expect(wrapper.text()).toContain(MY_CONSTANT) 17 + expect(files).toContain('index.html') 18 + expect(files).toContain('Counter.vue.html') 19 + expect(files).toContain('Counter.component.ts.html') 20 + expect(files).not.toContain('Counter.component.ts?vue&type=script&src=true&lang.ts.html') 38 21 }) 39 22 40 - test('vue non-SFC, uses query parameters in file imports', async () => { 41 - const wrapper = mount(CounterVue) 23 + test('coverage results matches snapshot', async () => { 24 + const coverageMap = await readCoverageMap() 25 + const summary = coverageMap.getCoverageSummary() 42 26 43 - await wrapper.find('button').trigger('click') 44 - expect(wrapper.text()).contain(1) 27 + if (isV8Provider()) { 28 + expect(summary).toMatchInlineSnapshot(` 29 + { 30 + "branches": { 31 + "covered": 5, 32 + "pct": 83.33, 33 + "skipped": 0, 34 + "total": 6, 35 + }, 36 + "branchesTrue": { 37 + "covered": 0, 38 + "pct": "Unknown", 39 + "skipped": 0, 40 + "total": 0, 41 + }, 42 + "functions": { 43 + "covered": 3, 44 + "pct": 60, 45 + "skipped": 0, 46 + "total": 5, 47 + }, 48 + "lines": { 49 + "covered": 36, 50 + "pct": 81.81, 51 + "skipped": 0, 52 + "total": 44, 53 + }, 54 + "statements": { 55 + "covered": 36, 56 + "pct": 81.81, 57 + "skipped": 0, 58 + "total": 44, 59 + }, 60 + } 61 + `) 62 + } 63 + else { 64 + expect(summary).toMatchInlineSnapshot(` 65 + { 66 + "branches": { 67 + "covered": 5, 68 + "pct": 83.33, 69 + "skipped": 0, 70 + "total": 6, 71 + }, 72 + "branchesTrue": { 73 + "covered": 0, 74 + "pct": "Unknown", 75 + "skipped": 0, 76 + "total": 0, 77 + }, 78 + "functions": { 79 + "covered": 5, 80 + "pct": 71.42, 81 + "skipped": 0, 82 + "total": 7, 83 + }, 84 + "lines": { 85 + "covered": 13, 86 + "pct": 81.25, 87 + "skipped": 0, 88 + "total": 16, 89 + }, 90 + "statements": { 91 + "covered": 14, 92 + "pct": 82.35, 93 + "skipped": 0, 94 + "total": 17, 95 + }, 96 + } 97 + `) 98 + } 45 99 })
-9
test/coverage-test/test/web.test.ts
··· 1 - // @vitest-environment jsdom 2 - 3 - import { expect, test } from 'vitest' 4 - import { sum } from '../src/multi-environment' 5 - 6 - test('runs on client', () => { 7 - expect(sum(1, 2)).toBe(3) 8 - expect(sum(10, 23)).toBe(33) 9 - })
-36
test/coverage-test/coverage-report-tests/__snapshots__/custom.report.test.ts.snap
··· 1 - // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html 2 - 3 - exports[`custom json report 1`] = ` 4 - { 5 - "calls": [ 6 - "initialized with context", 7 - "resolveOptions", 8 - "clean with force", 9 - "onAfterSuiteRun", 10 - "reportCoverage with {"allTestsRun":true}", 11 - ], 12 - "coverageReports": [ 13 - "{"coverage":{"customCoverage":"Coverage report passed from workers to main thread"},"transformMode":"ssr","projectName":true}", 14 - "{"coverage":{"customCoverage":"Coverage report passed from workers to main thread"},"transformMode":"web","projectName":true}", 15 - ], 16 - "transformedFiles": [ 17 - "<process-cwd>/src/Counter/Counter.component.ts", 18 - "<process-cwd>/src/Counter/Counter.vue", 19 - "<process-cwd>/src/Counter/index.ts", 20 - "<process-cwd>/src/Defined.vue", 21 - "<process-cwd>/src/Hello.vue", 22 - "<process-cwd>/src/another-setup.ts", 23 - "<process-cwd>/src/decorators.ts", 24 - "<process-cwd>/src/dynamic-file-esm.ignore.js", 25 - "<process-cwd>/src/dynamic-files.ts", 26 - "<process-cwd>/src/function-count.ts", 27 - "<process-cwd>/src/implicitElse.ts", 28 - "<process-cwd>/src/importEnv.ts", 29 - "<process-cwd>/src/index.mts", 30 - "<process-cwd>/src/multi-environment.ts", 31 - "<process-cwd>/src/multi-suite.ts", 32 - "<process-cwd>/src/transpiled.js", 33 - "<process-cwd>/src/utils.ts", 34 - ], 35 - } 36 - `;
-3516
test/coverage-test/coverage-report-tests/__snapshots__/istanbul.report.test.ts.snap
··· 1 - // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html 2 - 3 - exports[`istanbul json report 1`] = ` 4 - { 5 - "<process-cwd>/src/Counter/Counter.component.ts": { 6 - "b": {}, 7 - "branchMap": {}, 8 - "f": { 9 - "0": 1, 10 - "1": 0, 11 - "2": 2, 12 - "3": 0, 13 - }, 14 - "fnMap": { 15 - "0": { 16 - "decl": { 17 - "end": { 18 - "column": 10, 19 - "line": 6, 20 - }, 21 - "start": { 22 - "column": 2, 23 - "line": 6, 24 - }, 25 - }, 26 - "loc": { 27 - "end": { 28 - "column": null, 29 - "line": 9, 30 - }, 31 - "start": { 32 - "column": 10, 33 - "line": 6, 34 - }, 35 - }, 36 - "name": "(anonymous_0)", 37 - }, 38 - "1": { 39 - "decl": { 40 - "end": { 41 - "column": 22, 42 - "line": 12, 43 - }, 44 - "start": { 45 - "column": 4, 46 - "line": 12, 47 - }, 48 - }, 49 - "loc": { 50 - "end": { 51 - "column": null, 52 - "line": 14, 53 - }, 54 - "start": { 55 - "column": 22, 56 - "line": 12, 57 - }, 58 - }, 59 - "name": "(anonymous_1)", 60 - }, 61 - "2": { 62 - "decl": { 63 - "end": { 64 - "column": 20, 65 - "line": 16, 66 - }, 67 - "start": { 68 - "column": 4, 69 - "line": 16, 70 - }, 71 - }, 72 - "loc": { 73 - "end": { 74 - "column": null, 75 - "line": 18, 76 - }, 77 - "start": { 78 - "column": 20, 79 - "line": 16, 80 - }, 81 - }, 82 - "name": "(anonymous_2)", 83 - }, 84 - "3": { 85 - "decl": { 86 - "end": { 87 - "column": 37, 88 - "line": 20, 89 - }, 90 - "start": { 91 - "column": 4, 92 - "line": 20, 93 - }, 94 - }, 95 - "loc": { 96 - "end": { 97 - "column": null, 98 - "line": 22, 99 - }, 100 - "start": { 101 - "column": 37, 102 - "line": 20, 103 - }, 104 - }, 105 - "name": "(anonymous_3)", 106 - }, 107 - }, 108 - "path": "<process-cwd>/src/Counter/Counter.component.ts", 109 - "s": { 110 - "0": 1, 111 - "1": 1, 112 - "2": 0, 113 - "3": 2, 114 - "4": 0, 115 - }, 116 - "statementMap": { 117 - "0": { 118 - "end": { 119 - "column": null, 120 - "line": 7, 121 - }, 122 - "start": { 123 - "column": 18, 124 - "line": 7, 125 - }, 126 - }, 127 - "1": { 128 - "end": { 129 - "column": null, 130 - "line": 8, 131 - }, 132 - "start": { 133 - "column": 4, 134 - "line": 8, 135 - }, 136 - }, 137 - "2": { 138 - "end": { 139 - "column": null, 140 - "line": 13, 141 - }, 142 - "start": { 143 - "column": 6, 144 - "line": 13, 145 - }, 146 - }, 147 - "3": { 148 - "end": { 149 - "column": null, 150 - "line": 17, 151 - }, 152 - "start": { 153 - "column": 6, 154 - "line": 17, 155 - }, 156 - }, 157 - "4": { 158 - "end": { 159 - "column": null, 160 - "line": 21, 161 - }, 162 - "start": { 163 - "column": 6, 164 - "line": 21, 165 - }, 166 - }, 167 - }, 168 - }, 169 - "<process-cwd>/src/Counter/Counter.vue": { 170 - "b": { 171 - "0": [ 172 - 2, 173 - 1, 174 - ], 175 - }, 176 - "branchMap": { 177 - "0": { 178 - "loc": { 179 - "end": { 180 - "column": null, 181 - "line": 8, 182 - }, 183 - "start": { 184 - "column": 18, 185 - "line": 8, 186 - }, 187 - }, 188 - "locations": [ 189 - { 190 - "end": { 191 - "column": null, 192 - "line": 8, 193 - }, 194 - "start": { 195 - "column": 18, 196 - "line": 8, 197 - }, 198 - }, 199 - { 200 - "end": { 201 - "column": null, 202 - "line": 8, 203 - }, 204 - "start": { 205 - "column": 18, 206 - "line": 8, 207 - }, 208 - }, 209 - ], 210 - "type": "binary-expr", 211 - }, 212 - }, 213 - "f": { 214 - "0": 1, 215 - }, 216 - "fnMap": { 217 - "0": { 218 - "decl": { 219 - "end": { 220 - "column": null, 221 - "line": 8, 222 - }, 223 - "start": { 224 - "column": 18, 225 - "line": 8, 226 - }, 227 - }, 228 - "loc": { 229 - "end": { 230 - "column": null, 231 - "line": 8, 232 - }, 233 - "start": { 234 - "column": 18, 235 - "line": 8, 236 - }, 237 - }, 238 - "name": "(anonymous_1)", 239 - }, 240 - }, 241 - "path": "<process-cwd>/src/Counter/Counter.vue", 242 - "s": { 243 - "0": 1, 244 - }, 245 - "statementMap": { 246 - "0": { 247 - "end": { 248 - "column": null, 249 - "line": 8, 250 - }, 251 - "start": { 252 - "column": 18, 253 - "line": 8, 254 - }, 255 - }, 256 - }, 257 - }, 258 - "<process-cwd>/src/Defined.vue": { 259 - "b": { 260 - "0": [ 261 - 1, 262 - 0, 263 - ], 264 - }, 265 - "branchMap": { 266 - "0": { 267 - "loc": { 268 - "end": { 269 - "column": null, 270 - "line": 10, 271 - }, 272 - "start": { 273 - "column": 0, 274 - "line": 5, 275 - }, 276 - }, 277 - "locations": [ 278 - { 279 - "end": { 280 - "column": null, 281 - "line": 10, 282 - }, 283 - "start": { 284 - "column": 0, 285 - "line": 5, 286 - }, 287 - }, 288 - { 289 - "end": { 290 - "column": null, 291 - "line": 10, 292 - }, 293 - "start": { 294 - "column": 5, 295 - "line": 8, 296 - }, 297 - }, 298 - ], 299 - "type": "if", 300 - }, 301 - }, 302 - "f": {}, 303 - "fnMap": {}, 304 - "path": "<process-cwd>/src/Defined.vue", 305 - "s": { 306 - "0": 1, 307 - "1": 1, 308 - "2": 1, 309 - "3": 0, 310 - "4": 1, 311 - }, 312 - "statementMap": { 313 - "0": { 314 - "end": { 315 - "column": null, 316 - "line": 2, 317 - }, 318 - "start": { 319 - "column": 16, 320 - "line": 2, 321 - }, 322 - }, 323 - "1": { 324 - "end": { 325 - "column": null, 326 - "line": 10, 327 - }, 328 - "start": { 329 - "column": 0, 330 - "line": 5, 331 - }, 332 - }, 333 - "2": { 334 - "end": { 335 - "column": null, 336 - "line": 6, 337 - }, 338 - "start": { 339 - "column": 2, 340 - "line": 6, 341 - }, 342 - }, 343 - "3": { 344 - "end": { 345 - "column": null, 346 - "line": 9, 347 - }, 348 - "start": { 349 - "column": 2, 350 - "line": 9, 351 - }, 352 - }, 353 - "4": { 354 - "end": { 355 - "column": null, 356 - "line": 14, 357 - }, 358 - "start": { 359 - "column": 5, 360 - "line": 14, 361 - }, 362 - }, 363 - }, 364 - }, 365 - "<process-cwd>/src/Hello.vue": { 366 - "b": { 367 - "0": [ 368 - 3, 369 - 1, 370 - ], 371 - }, 372 - "branchMap": { 373 - "0": { 374 - "loc": { 375 - "end": { 376 - "column": 30, 377 - "line": 14, 378 - }, 379 - "start": { 380 - "column": 16, 381 - "line": 14, 382 - }, 383 - }, 384 - "locations": [ 385 - { 386 - "end": { 387 - "column": 18, 388 - "line": 14, 389 - }, 390 - "start": { 391 - "column": 16, 392 - "line": 14, 393 - }, 394 - }, 395 - { 396 - "end": { 397 - "column": 30, 398 - "line": 14, 399 - }, 400 - "start": { 401 - "column": 16, 402 - "line": 14, 403 - }, 404 - }, 405 - ], 406 - "type": "binary-expr", 407 - }, 408 - }, 409 - "f": { 410 - "0": 3, 411 - "1": 2, 412 - }, 413 - "fnMap": { 414 - "0": { 415 - "decl": { 416 - "end": { 417 - "column": 30, 418 - "line": 7, 419 - }, 420 - "start": { 421 - "column": 24, 422 - "line": 7, 423 - }, 424 - }, 425 - "loc": { 426 - "end": { 427 - "column": 55, 428 - "line": 7, 429 - }, 430 - "start": { 431 - "column": 30, 432 - "line": 7, 433 - }, 434 - }, 435 - "name": "(anonymous_1)", 436 - }, 437 - "1": { 438 - "decl": { 439 - "end": { 440 - "column": 18, 441 - "line": 14, 442 - }, 443 - "start": { 444 - "column": 16, 445 - "line": 14, 446 - }, 447 - }, 448 - "loc": { 449 - "end": { 450 - "column": 30, 451 - "line": 14, 452 - }, 453 - "start": { 454 - "column": 18, 455 - "line": 14, 456 - }, 457 - }, 458 - "name": "(anonymous_3)", 459 - }, 460 - }, 461 - "path": "<process-cwd>/src/Hello.vue", 462 - "s": { 463 - "0": 1, 464 - "1": 1, 465 - "2": 1, 466 - "3": 3, 467 - "4": 1, 468 - "5": 2, 469 - }, 470 - "statementMap": { 471 - "0": { 472 - "end": { 473 - "column": null, 474 - "line": 4, 475 - }, 476 - "start": { 477 - "column": 14, 478 - "line": 4, 479 - }, 480 - }, 481 - "1": { 482 - "end": { 483 - "column": null, 484 - "line": 6, 485 - }, 486 - "start": { 487 - "column": 14, 488 - "line": 6, 489 - }, 490 - }, 491 - "2": { 492 - "end": { 493 - "column": null, 494 - "line": 7, 495 - }, 496 - "start": { 497 - "column": 15, 498 - "line": 7, 499 - }, 500 - }, 501 - "3": { 502 - "end": { 503 - "column": 55, 504 - "line": 7, 505 - }, 506 - "start": { 507 - "column": 30, 508 - "line": 7, 509 - }, 510 - }, 511 - "4": { 512 - "end": { 513 - "column": null, 514 - "line": 9, 515 - }, 516 - "start": { 517 - "column": 0, 518 - "line": 9, 519 - }, 520 - }, 521 - "5": { 522 - "end": { 523 - "column": 30, 524 - "line": 14, 525 - }, 526 - "start": { 527 - "column": 18, 528 - "line": 14, 529 - }, 530 - }, 531 - }, 532 - }, 533 - "<process-cwd>/src/decorators.ts": { 534 - "b": { 535 - "0": [ 536 - 1, 537 - 0, 538 - ], 539 - "1": [ 540 - 0, 541 - 1, 542 - ], 543 - }, 544 - "branchMap": { 545 - "0": { 546 - "loc": { 547 - "end": { 548 - "column": null, 549 - "line": 8, 550 - }, 551 - "start": { 552 - "column": 4, 553 - "line": 5, 554 - }, 555 - }, 556 - "locations": [ 557 - { 558 - "end": { 559 - "column": null, 560 - "line": 8, 561 - }, 562 - "start": { 563 - "column": 4, 564 - "line": 5, 565 - }, 566 - }, 567 - { 568 - "end": { 569 - "column": null, 570 - "line": 8, 571 - }, 572 - "start": { 573 - "column": 4, 574 - "line": 5, 575 - }, 576 - }, 577 - ], 578 - "type": "if", 579 - }, 580 - "1": { 581 - "loc": { 582 - "end": { 583 - "column": null, 584 - "line": 13, 585 - }, 586 - "start": { 587 - "column": 4, 588 - "line": 10, 589 - }, 590 - }, 591 - "locations": [ 592 - { 593 - "end": { 594 - "column": null, 595 - "line": 13, 596 - }, 597 - "start": { 598 - "column": 4, 599 - "line": 10, 600 - }, 601 - }, 602 - { 603 - "end": { 604 - "column": null, 605 - "line": 13, 606 - }, 607 - "start": { 608 - "column": 4, 609 - "line": 10, 610 - }, 611 - }, 612 - ], 613 - "type": "if", 614 - }, 615 - }, 616 - "f": { 617 - "0": 1, 618 - "1": 1, 619 - "2": 1, 620 - }, 621 - "fnMap": { 622 - "0": { 623 - "decl": { 624 - "end": { 625 - "column": 9, 626 - "line": 4, 627 - }, 628 - "start": { 629 - "column": 2, 630 - "line": 4, 631 - }, 632 - }, 633 - "loc": { 634 - "end": { 635 - "column": null, 636 - "line": 14, 637 - }, 638 - "start": { 639 - "column": 46, 640 - "line": 4, 641 - }, 642 - }, 643 - "name": "(anonymous_4)", 644 - }, 645 - "1": { 646 - "decl": { 647 - "end": { 648 - "column": null, 649 - "line": 17, 650 - }, 651 - "start": { 652 - "column": 9, 653 - "line": 17, 654 - }, 655 - }, 656 - "loc": { 657 - "end": { 658 - "column": null, 659 - "line": 21, 660 - }, 661 - "start": { 662 - "column": 25, 663 - "line": 20, 664 - }, 665 - }, 666 - "name": "SomeDecorator", 667 - }, 668 - "2": { 669 - "decl": { 670 - "end": { 671 - "column": 17, 672 - "line": 25, 673 - }, 674 - "start": { 675 - "column": 9, 676 - "line": 25, 677 - }, 678 - }, 679 - "loc": { 680 - "end": { 681 - "column": null, 682 - "line": 27, 683 - }, 684 - "start": { 685 - "column": 33, 686 - "line": 25, 687 - }, 688 - }, 689 - "name": "noop", 690 - }, 691 - }, 692 - "path": "<process-cwd>/src/decorators.ts", 693 - "s": { 694 - "0": 1, 695 - "1": 1, 696 - "2": 1, 697 - "3": 0, 698 - }, 699 - "statementMap": { 700 - "0": { 701 - "end": { 702 - "column": null, 703 - "line": 8, 704 - }, 705 - "start": { 706 - "column": 4, 707 - "line": 5, 708 - }, 709 - }, 710 - "1": { 711 - "end": { 712 - "column": null, 713 - "line": 7, 714 - }, 715 - "start": { 716 - "column": 6, 717 - "line": 7, 718 - }, 719 - }, 720 - "2": { 721 - "end": { 722 - "column": null, 723 - "line": 13, 724 - }, 725 - "start": { 726 - "column": 4, 727 - "line": 10, 728 - }, 729 - }, 730 - "3": { 731 - "end": { 732 - "column": null, 733 - "line": 12, 734 - }, 735 - "start": { 736 - "column": 6, 737 - "line": 12, 738 - }, 739 - }, 740 - }, 741 - }, 742 - "<process-cwd>/src/dynamic-files.ts": { 743 - "b": { 744 - "0": [ 745 - 0, 746 - 0, 747 - ], 748 - "1": [ 749 - 0, 750 - 0, 751 - ], 752 - "2": [ 753 - 0, 754 - 0, 755 - ], 756 - "3": [ 757 - 0, 758 - 0, 759 - ], 760 - }, 761 - "branchMap": { 762 - "0": { 763 - "loc": { 764 - "end": { 765 - "column": null, 766 - "line": 10, 767 - }, 768 - "start": { 769 - "column": 2, 770 - "line": 8, 771 - }, 772 - }, 773 - "locations": [ 774 - { 775 - "end": { 776 - "column": null, 777 - "line": 10, 778 - }, 779 - "start": { 780 - "column": 2, 781 - "line": 8, 782 - }, 783 - }, 784 - { 785 - "end": { 786 - "column": null, 787 - "line": 10, 788 - }, 789 - "start": { 790 - "column": 2, 791 - "line": 8, 792 - }, 793 - }, 794 - ], 795 - "type": "if", 796 - }, 797 - "1": { 798 - "loc": { 799 - "end": { 800 - "column": null, 801 - "line": 24, 802 - }, 803 - "start": { 804 - "column": 2, 805 - "line": 22, 806 - }, 807 - }, 808 - "locations": [ 809 - { 810 - "end": { 811 - "column": null, 812 - "line": 24, 813 - }, 814 - "start": { 815 - "column": 2, 816 - "line": 22, 817 - }, 818 - }, 819 - { 820 - "end": { 821 - "column": null, 822 - "line": 24, 823 - }, 824 - "start": { 825 - "column": 2, 826 - "line": 22, 827 - }, 828 - }, 829 - ], 830 - "type": "if", 831 - }, 832 - "2": { 833 - "loc": { 834 - "end": { 835 - "column": null, 836 - "line": 34, 837 - }, 838 - "start": { 839 - "column": 2, 840 - "line": 32, 841 - }, 842 - }, 843 - "locations": [ 844 - { 845 - "end": { 846 - "column": null, 847 - "line": 34, 848 - }, 849 - "start": { 850 - "column": 2, 851 - "line": 32, 852 - }, 853 - }, 854 - { 855 - "end": { 856 - "column": null, 857 - "line": 34, 858 - }, 859 - "start": { 860 - "column": 2, 861 - "line": 32, 862 - }, 863 - }, 864 - ], 865 - "type": "if", 866 - }, 867 - "3": { 868 - "loc": { 869 - "end": { 870 - "column": null, 871 - "line": 48, 872 - }, 873 - "start": { 874 - "column": 2, 875 - "line": 46, 876 - }, 877 - }, 878 - "locations": [ 879 - { 880 - "end": { 881 - "column": null, 882 - "line": 48, 883 - }, 884 - "start": { 885 - "column": 2, 886 - "line": 46, 887 - }, 888 - }, 889 - { 890 - "end": { 891 - "column": null, 892 - "line": 48, 893 - }, 894 - "start": { 895 - "column": 2, 896 - "line": 46, 897 - }, 898 - }, 899 - ], 900 - "type": "if", 901 - }, 902 - }, 903 - "f": { 904 - "0": 0, 905 - "1": 0, 906 - }, 907 - "fnMap": { 908 - "0": { 909 - "decl": { 910 - "end": { 911 - "column": 42, 912 - "line": 5, 913 - }, 914 - "start": { 915 - "column": 22, 916 - "line": 5, 917 - }, 918 - }, 919 - "loc": { 920 - "end": { 921 - "column": null, 922 - "line": 27, 923 - }, 924 - "start": { 925 - "column": 42, 926 - "line": 5, 927 - }, 928 - }, 929 - "name": "runDynamicFileESM", 930 - }, 931 - "1": { 932 - "decl": { 933 - "end": { 934 - "column": 42, 935 - "line": 29, 936 - }, 937 - "start": { 938 - "column": 22, 939 - "line": 29, 940 - }, 941 - }, 942 - "loc": { 943 - "end": { 944 - "column": null, 945 - "line": 51, 946 - }, 947 - "start": { 948 - "column": 42, 949 - "line": 29, 950 - }, 951 - }, 952 - "name": "runDynamicFileCJS", 953 - }, 954 - }, 955 - "path": "<process-cwd>/src/dynamic-files.ts", 956 - "s": { 957 - "0": 0, 958 - "1": 0, 959 - "10": 0, 960 - "11": 0, 961 - "12": 0, 962 - "13": 0, 963 - "14": 0, 964 - "15": 0, 965 - "2": 0, 966 - "3": 0, 967 - "4": 0, 968 - "5": 0, 969 - "6": 0, 970 - "7": 0, 971 - "8": 0, 972 - "9": 0, 973 - }, 974 - "statementMap": { 975 - "0": { 976 - "end": { 977 - "column": null, 978 - "line": 6, 979 - }, 980 - "start": { 981 - "column": 19, 982 - "line": 6, 983 - }, 984 - }, 985 - "1": { 986 - "end": { 987 - "column": null, 988 - "line": 10, 989 - }, 990 - "start": { 991 - "column": 2, 992 - "line": 8, 993 - }, 994 - }, 995 - "10": { 996 - "end": { 997 - "column": null, 998 - "line": 33, 999 - }, 1000 - "start": { 1001 - "column": 4, 1002 - "line": 33, 1003 - }, 1004 - }, 1005 - "11": { 1006 - "end": { 1007 - "column": null, 1008 - "line": 42, 1009 - }, 1010 - "start": { 1011 - "column": 2, 1012 - "line": 36, 1013 - }, 1014 - }, 1015 - "12": { 1016 - "end": { 1017 - "column": null, 1018 - "line": 44, 1019 - }, 1020 - "start": { 1021 - "column": 18, 1022 - "line": 44, 1023 - }, 1024 - }, 1025 - "13": { 1026 - "end": { 1027 - "column": null, 1028 - "line": 48, 1029 - }, 1030 - "start": { 1031 - "column": 2, 1032 - "line": 46, 1033 - }, 1034 - }, 1035 - "14": { 1036 - "end": { 1037 - "column": null, 1038 - "line": 47, 1039 - }, 1040 - "start": { 1041 - "column": 4, 1042 - "line": 47, 1043 - }, 1044 - }, 1045 - "15": { 1046 - "end": { 1047 - "column": null, 1048 - "line": 50, 1049 - }, 1050 - "start": { 1051 - "column": 2, 1052 - "line": 50, 1053 - }, 1054 - }, 1055 - "2": { 1056 - "end": { 1057 - "column": null, 1058 - "line": 9, 1059 - }, 1060 - "start": { 1061 - "column": 4, 1062 - "line": 9, 1063 - }, 1064 - }, 1065 - "3": { 1066 - "end": { 1067 - "column": null, 1068 - "line": 18, 1069 - }, 1070 - "start": { 1071 - "column": 2, 1072 - "line": 12, 1073 - }, 1074 - }, 1075 - "4": { 1076 - "end": { 1077 - "column": null, 1078 - "line": 20, 1079 - }, 1080 - "start": { 1081 - "column": 18, 1082 - "line": 20, 1083 - }, 1084 - }, 1085 - "5": { 1086 - "end": { 1087 - "column": null, 1088 - "line": 24, 1089 - }, 1090 - "start": { 1091 - "column": 2, 1092 - "line": 22, 1093 - }, 1094 - }, 1095 - "6": { 1096 - "end": { 1097 - "column": null, 1098 - "line": 23, 1099 - }, 1100 - "start": { 1101 - "column": 4, 1102 - "line": 23, 1103 - }, 1104 - }, 1105 - "7": { 1106 - "end": { 1107 - "column": null, 1108 - "line": 26, 1109 - }, 1110 - "start": { 1111 - "column": 2, 1112 - "line": 26, 1113 - }, 1114 - }, 1115 - "8": { 1116 - "end": { 1117 - "column": null, 1118 - "line": 30, 1119 - }, 1120 - "start": { 1121 - "column": 19, 1122 - "line": 30, 1123 - }, 1124 - }, 1125 - "9": { 1126 - "end": { 1127 - "column": null, 1128 - "line": 34, 1129 - }, 1130 - "start": { 1131 - "column": 2, 1132 - "line": 32, 1133 - }, 1134 - }, 1135 - }, 1136 - }, 1137 - "<process-cwd>/src/empty-lines.ts": { 1138 - "b": { 1139 - "0": [ 1140 - 0, 1141 - 0, 1142 - ], 1143 - "1": [ 1144 - 0, 1145 - 0, 1146 - ], 1147 - "2": [ 1148 - 0, 1149 - 0, 1150 - ], 1151 - "3": [ 1152 - 0, 1153 - 0, 1154 - ], 1155 - }, 1156 - "branchMap": { 1157 - "0": { 1158 - "loc": { 1159 - "end": { 1160 - "column": null, 1161 - "line": 11, 1162 - }, 1163 - "start": { 1164 - "column": 2, 1165 - "line": 8, 1166 - }, 1167 - }, 1168 - "locations": [ 1169 - { 1170 - "end": { 1171 - "column": null, 1172 - "line": 11, 1173 - }, 1174 - "start": { 1175 - "column": 2, 1176 - "line": 8, 1177 - }, 1178 - }, 1179 - { 1180 - "end": { 1181 - "column": null, 1182 - "line": 11, 1183 - }, 1184 - "start": { 1185 - "column": 2, 1186 - "line": 8, 1187 - }, 1188 - }, 1189 - ], 1190 - "type": "if", 1191 - }, 1192 - "1": { 1193 - "loc": { 1194 - "end": { 1195 - "column": 26, 1196 - "line": 8, 1197 - }, 1198 - "start": { 1199 - "column": 6, 1200 - "line": 8, 1201 - }, 1202 - }, 1203 - "locations": [ 1204 - { 1205 - "end": { 1206 - "column": 17, 1207 - "line": 8, 1208 - }, 1209 - "start": { 1210 - "column": 6, 1211 - "line": 8, 1212 - }, 1213 - }, 1214 - { 1215 - "end": { 1216 - "column": 26, 1217 - "line": 8, 1218 - }, 1219 - "start": { 1220 - "column": 17, 1221 - "line": 8, 1222 - }, 1223 - }, 1224 - ], 1225 - "type": "binary-expr", 1226 - }, 1227 - "2": { 1228 - "loc": { 1229 - "end": { 1230 - "column": null, 1231 - "line": 18, 1232 - }, 1233 - "start": { 1234 - "column": 2, 1235 - "line": 15, 1236 - }, 1237 - }, 1238 - "locations": [ 1239 - { 1240 - "end": { 1241 - "column": null, 1242 - "line": 18, 1243 - }, 1244 - "start": { 1245 - "column": 2, 1246 - "line": 15, 1247 - }, 1248 - }, 1249 - { 1250 - "end": { 1251 - "column": null, 1252 - "line": 18, 1253 - }, 1254 - "start": { 1255 - "column": 2, 1256 - "line": 15, 1257 - }, 1258 - }, 1259 - ], 1260 - "type": "if", 1261 - }, 1262 - "3": { 1263 - "loc": { 1264 - "end": { 1265 - "column": 26, 1266 - "line": 15, 1267 - }, 1268 - "start": { 1269 - "column": 6, 1270 - "line": 15, 1271 - }, 1272 - }, 1273 - "locations": [ 1274 - { 1275 - "end": { 1276 - "column": 17, 1277 - "line": 15, 1278 - }, 1279 - "start": { 1280 - "column": 6, 1281 - "line": 15, 1282 - }, 1283 - }, 1284 - { 1285 - "end": { 1286 - "column": 26, 1287 - "line": 15, 1288 - }, 1289 - "start": { 1290 - "column": 17, 1291 - "line": 15, 1292 - }, 1293 - }, 1294 - ], 1295 - "type": "binary-expr", 1296 - }, 1297 - }, 1298 - "f": { 1299 - "0": 0, 1300 - }, 1301 - "fnMap": { 1302 - "0": { 1303 - "decl": { 1304 - "end": { 1305 - "column": 20, 1306 - "line": 2, 1307 - }, 1308 - "start": { 1309 - "column": 16, 1310 - "line": 2, 1311 - }, 1312 - }, 1313 - "loc": { 1314 - "end": { 1315 - "column": null, 1316 - "line": 29, 1317 - }, 1318 - "start": { 1319 - "column": 42, 1320 - "line": 2, 1321 - }, 1322 - }, 1323 - "name": "add", 1324 - }, 1325 - }, 1326 - "path": "<process-cwd>/src/empty-lines.ts", 1327 - "s": { 1328 - "0": 0, 1329 - "1": 0, 1330 - "2": 0, 1331 - "3": 0, 1332 - "4": 0, 1333 - }, 1334 - "statementMap": { 1335 - "0": { 1336 - "end": { 1337 - "column": null, 1338 - "line": 11, 1339 - }, 1340 - "start": { 1341 - "column": 2, 1342 - "line": 8, 1343 - }, 1344 - }, 1345 - "1": { 1346 - "end": { 1347 - "column": null, 1348 - "line": 10, 1349 - }, 1350 - "start": { 1351 - "column": 4, 1352 - "line": 10, 1353 - }, 1354 - }, 1355 - "2": { 1356 - "end": { 1357 - "column": null, 1358 - "line": 18, 1359 - }, 1360 - "start": { 1361 - "column": 2, 1362 - "line": 15, 1363 - }, 1364 - }, 1365 - "3": { 1366 - "end": { 1367 - "column": null, 1368 - "line": 17, 1369 - }, 1370 - "start": { 1371 - "column": 4, 1372 - "line": 17, 1373 - }, 1374 - }, 1375 - "4": { 1376 - "end": { 1377 - "column": null, 1378 - "line": 28, 1379 - }, 1380 - "start": { 1381 - "column": 2, 1382 - "line": 28, 1383 - }, 1384 - }, 1385 - }, 1386 - }, 1387 - "<process-cwd>/src/file-to-change.ts": { 1388 - "b": {}, 1389 - "branchMap": {}, 1390 - "f": { 1391 - "0": 0, 1392 - "1": 0, 1393 - }, 1394 - "fnMap": { 1395 - "0": { 1396 - "decl": { 1397 - "end": { 1398 - "column": 22, 1399 - "line": 1, 1400 - }, 1401 - "start": { 1402 - "column": 16, 1403 - "line": 1, 1404 - }, 1405 - }, 1406 - "loc": { 1407 - "end": { 1408 - "column": null, 1409 - "line": 3, 1410 - }, 1411 - "start": { 1412 - "column": 22, 1413 - "line": 1, 1414 - }, 1415 - }, 1416 - "name": "run", 1417 - }, 1418 - "1": { 1419 - "decl": { 1420 - "end": { 1421 - "column": 36, 1422 - "line": 5, 1423 - }, 1424 - "start": { 1425 - "column": 16, 1426 - "line": 5, 1427 - }, 1428 - }, 1429 - "loc": { 1430 - "end": { 1431 - "column": null, 1432 - "line": 7, 1433 - }, 1434 - "start": { 1435 - "column": 36, 1436 - "line": 5, 1437 - }, 1438 - }, 1439 - "name": "uncoveredFunction", 1440 - }, 1441 - }, 1442 - "path": "<process-cwd>/src/file-to-change.ts", 1443 - "s": { 1444 - "0": 0, 1445 - "1": 0, 1446 - }, 1447 - "statementMap": { 1448 - "0": { 1449 - "end": { 1450 - "column": null, 1451 - "line": 2, 1452 - }, 1453 - "start": { 1454 - "column": 2, 1455 - "line": 2, 1456 - }, 1457 - }, 1458 - "1": { 1459 - "end": { 1460 - "column": null, 1461 - "line": 6, 1462 - }, 1463 - "start": { 1464 - "column": 2, 1465 - "line": 6, 1466 - }, 1467 - }, 1468 - }, 1469 - }, 1470 - "<process-cwd>/src/function-count.ts": { 1471 - "b": {}, 1472 - "branchMap": {}, 1473 - "f": { 1474 - "0": 1, 1475 - "1": 1, 1476 - "2": 0, 1477 - "3": 0, 1478 - "4": 1, 1479 - }, 1480 - "fnMap": { 1481 - "0": { 1482 - "decl": { 1483 - "end": { 1484 - "column": 17, 1485 - "line": 11, 1486 - }, 1487 - "start": { 1488 - "column": 9, 1489 - "line": 11, 1490 - }, 1491 - }, 1492 - "loc": { 1493 - "end": { 1494 - "column": null, 1495 - "line": 13, 1496 - }, 1497 - "start": { 1498 - "column": 17, 1499 - "line": 11, 1500 - }, 1501 - }, 1502 - "name": "first", 1503 - }, 1504 - "1": { 1505 - "decl": { 1506 - "end": { 1507 - "column": 25, 1508 - "line": 18, 1509 - }, 1510 - "start": { 1511 - "column": 16, 1512 - "line": 18, 1513 - }, 1514 - }, 1515 - "loc": { 1516 - "end": { 1517 - "column": null, 1518 - "line": 21, 1519 - }, 1520 - "start": { 1521 - "column": 25, 1522 - "line": 18, 1523 - }, 1524 - }, 1525 - "name": "second", 1526 - }, 1527 - "2": { 1528 - "decl": { 1529 - "end": { 1530 - "column": 24, 1531 - "line": 24, 1532 - }, 1533 - "start": { 1534 - "column": 16, 1535 - "line": 24, 1536 - }, 1537 - }, 1538 - "loc": { 1539 - "end": { 1540 - "column": null, 1541 - "line": 26, 1542 - }, 1543 - "start": { 1544 - "column": 24, 1545 - "line": 24, 1546 - }, 1547 - }, 1548 - "name": "third", 1549 - }, 1550 - "3": { 1551 - "decl": { 1552 - "end": { 1553 - "column": 18, 1554 - "line": 29, 1555 - }, 1556 - "start": { 1557 - "column": 9, 1558 - "line": 29, 1559 - }, 1560 - }, 1561 - "loc": { 1562 - "end": { 1563 - "column": null, 1564 - "line": 31, 1565 - }, 1566 - "start": { 1567 - "column": 18, 1568 - "line": 29, 1569 - }, 1570 - }, 1571 - "name": "fourth", 1572 - }, 1573 - "4": { 1574 - "decl": { 1575 - "end": { 1576 - "column": 17, 1577 - "line": 34, 1578 - }, 1579 - "start": { 1580 - "column": 9, 1581 - "line": 34, 1582 - }, 1583 - }, 1584 - "loc": { 1585 - "end": { 1586 - "column": null, 1587 - "line": 36, 1588 - }, 1589 - "start": { 1590 - "column": 17, 1591 - "line": 34, 1592 - }, 1593 - }, 1594 - "name": "fifth", 1595 - }, 1596 - }, 1597 - "path": "<process-cwd>/src/function-count.ts", 1598 - "s": { 1599 - "0": 1, 1600 - "1": 1, 1601 - "2": 1, 1602 - "3": 1, 1603 - "4": 0, 1604 - "5": 0, 1605 - "6": 1, 1606 - }, 1607 - "statementMap": { 1608 - "0": { 1609 - "end": { 1610 - "column": null, 1611 - "line": 12, 1612 - }, 1613 - "start": { 1614 - "column": 2, 1615 - "line": 12, 1616 - }, 1617 - }, 1618 - "1": { 1619 - "end": { 1620 - "column": null, 1621 - "line": 15, 1622 - }, 1623 - "start": { 1624 - "column": 0, 1625 - "line": 15, 1626 - }, 1627 - }, 1628 - "2": { 1629 - "end": { 1630 - "column": null, 1631 - "line": 19, 1632 - }, 1633 - "start": { 1634 - "column": 2, 1635 - "line": 19, 1636 - }, 1637 - }, 1638 - "3": { 1639 - "end": { 1640 - "column": null, 1641 - "line": 20, 1642 - }, 1643 - "start": { 1644 - "column": 2, 1645 - "line": 20, 1646 - }, 1647 - }, 1648 - "4": { 1649 - "end": { 1650 - "column": null, 1651 - "line": 25, 1652 - }, 1653 - "start": { 1654 - "column": 2, 1655 - "line": 25, 1656 - }, 1657 - }, 1658 - "5": { 1659 - "end": { 1660 - "column": null, 1661 - "line": 30, 1662 - }, 1663 - "start": { 1664 - "column": 2, 1665 - "line": 30, 1666 - }, 1667 - }, 1668 - "6": { 1669 - "end": { 1670 - "column": null, 1671 - "line": 35, 1672 - }, 1673 - "start": { 1674 - "column": 2, 1675 - "line": 35, 1676 - }, 1677 - }, 1678 - }, 1679 - }, 1680 - "<process-cwd>/src/implicitElse.ts": { 1681 - "b": { 1682 - "0": [ 1683 - 1, 1684 - 0, 1685 - ], 1686 - }, 1687 - "branchMap": { 1688 - "0": { 1689 - "loc": { 1690 - "end": { 1691 - "column": null, 1692 - "line": 6, 1693 - }, 1694 - "start": { 1695 - "column": 2, 1696 - "line": 4, 1697 - }, 1698 - }, 1699 - "locations": [ 1700 - { 1701 - "end": { 1702 - "column": null, 1703 - "line": 6, 1704 - }, 1705 - "start": { 1706 - "column": 2, 1707 - "line": 4, 1708 - }, 1709 - }, 1710 - { 1711 - "end": { 1712 - "column": null, 1713 - "line": 6, 1714 - }, 1715 - "start": { 1716 - "column": 2, 1717 - "line": 4, 1718 - }, 1719 - }, 1720 - ], 1721 - "type": "if", 1722 - }, 1723 - }, 1724 - "f": { 1725 - "0": 1, 1726 - }, 1727 - "fnMap": { 1728 - "0": { 1729 - "decl": { 1730 - "end": { 1731 - "column": 29, 1732 - "line": 1, 1733 - }, 1734 - "start": { 1735 - "column": 16, 1736 - "line": 1, 1737 - }, 1738 - }, 1739 - "loc": { 1740 - "end": { 1741 - "column": null, 1742 - "line": 9, 1743 - }, 1744 - "start": { 1745 - "column": 49, 1746 - "line": 1, 1747 - }, 1748 - }, 1749 - "name": "implicitElse", 1750 - }, 1751 - }, 1752 - "path": "<process-cwd>/src/implicitElse.ts", 1753 - "s": { 1754 - "0": 1, 1755 - "1": 1, 1756 - "2": 1, 1757 - "3": 1, 1758 - }, 1759 - "statementMap": { 1760 - "0": { 1761 - "end": { 1762 - "column": null, 1763 - "line": 2, 1764 - }, 1765 - "start": { 1766 - "column": 10, 1767 - "line": 2, 1768 - }, 1769 - }, 1770 - "1": { 1771 - "end": { 1772 - "column": null, 1773 - "line": 6, 1774 - }, 1775 - "start": { 1776 - "column": 2, 1777 - "line": 4, 1778 - }, 1779 - }, 1780 - "2": { 1781 - "end": { 1782 - "column": null, 1783 - "line": 5, 1784 - }, 1785 - "start": { 1786 - "column": 4, 1787 - "line": 5, 1788 - }, 1789 - }, 1790 - "3": { 1791 - "end": { 1792 - "column": null, 1793 - "line": 8, 1794 - }, 1795 - "start": { 1796 - "column": 2, 1797 - "line": 8, 1798 - }, 1799 - }, 1800 - }, 1801 - }, 1802 - "<process-cwd>/src/importEnv.ts": { 1803 - "b": {}, 1804 - "branchMap": {}, 1805 - "f": { 1806 - "0": 1, 1807 - }, 1808 - "fnMap": { 1809 - "0": { 1810 - "decl": { 1811 - "end": { 1812 - "column": 31, 1813 - "line": 1, 1814 - }, 1815 - "start": { 1816 - "column": 16, 1817 - "line": 1, 1818 - }, 1819 - }, 1820 - "loc": { 1821 - "end": { 1822 - "column": null, 1823 - "line": 3, 1824 - }, 1825 - "start": { 1826 - "column": 31, 1827 - "line": 1, 1828 - }, 1829 - }, 1830 - "name": "useImportEnv", 1831 - }, 1832 - }, 1833 - "path": "<process-cwd>/src/importEnv.ts", 1834 - "s": { 1835 - "0": 1, 1836 - }, 1837 - "statementMap": { 1838 - "0": { 1839 - "end": { 1840 - "column": null, 1841 - "line": 2, 1842 - }, 1843 - "start": { 1844 - "column": 2, 1845 - "line": 2, 1846 - }, 1847 - }, 1848 - }, 1849 - }, 1850 - "<process-cwd>/src/index.mts": { 1851 - "b": {}, 1852 - "branchMap": {}, 1853 - "f": { 1854 - "0": 1, 1855 - }, 1856 - "fnMap": { 1857 - "0": { 1858 - "decl": { 1859 - "end": { 1860 - "column": 27, 1861 - "line": 5, 1862 - }, 1863 - "start": { 1864 - "column": 16, 1865 - "line": 5, 1866 - }, 1867 - }, 1868 - "loc": { 1869 - "end": { 1870 - "column": null, 1871 - "line": 7, 1872 - }, 1873 - "start": { 1874 - "column": 49, 1875 - "line": 5, 1876 - }, 1877 - }, 1878 - "name": "pythagoras", 1879 - }, 1880 - }, 1881 - "path": "<process-cwd>/src/index.mts", 1882 - "s": { 1883 - "0": 1, 1884 - }, 1885 - "statementMap": { 1886 - "0": { 1887 - "end": { 1888 - "column": null, 1889 - "line": 6, 1890 - }, 1891 - "start": { 1892 - "column": 2, 1893 - "line": 6, 1894 - }, 1895 - }, 1896 - }, 1897 - }, 1898 - "<process-cwd>/src/load-outside-vite.cjs": { 1899 - "b": {}, 1900 - "branchMap": {}, 1901 - "f": { 1902 - "0": 0, 1903 - }, 1904 - "fnMap": { 1905 - "0": { 1906 - "decl": { 1907 - "end": { 1908 - "column": 30, 1909 - "line": 1, 1910 - }, 1911 - "start": { 1912 - "column": 26, 1913 - "line": 1, 1914 - }, 1915 - }, 1916 - "loc": { 1917 - "end": { 1918 - "column": 35, 1919 - "line": 1, 1920 - }, 1921 - "start": { 1922 - "column": 33, 1923 - "line": 1, 1924 - }, 1925 - }, 1926 - "name": "noop", 1927 - }, 1928 - }, 1929 - "path": "<process-cwd>/src/load-outside-vite.cjs", 1930 - "s": { 1931 - "0": 0, 1932 - }, 1933 - "statementMap": { 1934 - "0": { 1935 - "end": { 1936 - "column": 35, 1937 - "line": 1, 1938 - }, 1939 - "start": { 1940 - "column": 0, 1941 - "line": 1, 1942 - }, 1943 - }, 1944 - }, 1945 - }, 1946 - "<process-cwd>/src/multi-environment.ts": { 1947 - "b": { 1948 - "0": [ 1949 - 0, 1950 - 4, 1951 - ], 1952 - "1": [ 1953 - 4, 1954 - 0, 1955 - ], 1956 - "2": [ 1957 - 1, 1958 - 3, 1959 - ], 1960 - "3": [ 1961 - 4, 1962 - 1, 1963 - ], 1964 - "4": [ 1965 - 0, 1966 - 3, 1967 - ], 1968 - "5": [ 1969 - 3, 1970 - 0, 1971 - ], 1972 - "6": [ 1973 - 1, 1974 - 2, 1975 - ], 1976 - "7": [ 1977 - 3, 1978 - 1, 1979 - ], 1980 - }, 1981 - "branchMap": { 1982 - "0": { 1983 - "loc": { 1984 - "end": { 1985 - "column": null, 1986 - "line": 27, 1987 - }, 1988 - "start": { 1989 - "column": 2, 1990 - "line": 11, 1991 - }, 1992 - }, 1993 - "locations": [ 1994 - { 1995 - "end": { 1996 - "column": null, 1997 - "line": 27, 1998 - }, 1999 - "start": { 2000 - "column": 2, 2001 - "line": 11, 2002 - }, 2003 - }, 2004 - { 2005 - "end": { 2006 - "column": null, 2007 - "line": 27, 2008 - }, 2009 - "start": { 2010 - "column": 2, 2011 - "line": 14, 2012 - }, 2013 - }, 2014 - ], 2015 - "type": "if", 2016 - }, 2017 - "1": { 2018 - "loc": { 2019 - "end": { 2020 - "column": 26, 2021 - "line": 11, 2022 - }, 2023 - "start": { 2024 - "column": 6, 2025 - "line": 11, 2026 - }, 2027 - }, 2028 - "locations": [ 2029 - { 2030 - "end": { 2031 - "column": 17, 2032 - "line": 11, 2033 - }, 2034 - "start": { 2035 - "column": 6, 2036 - "line": 11, 2037 - }, 2038 - }, 2039 - { 2040 - "end": { 2041 - "column": 26, 2042 - "line": 11, 2043 - }, 2044 - "start": { 2045 - "column": 17, 2046 - "line": 11, 2047 - }, 2048 - }, 2049 - ], 2050 - "type": "binary-expr", 2051 - }, 2052 - "2": { 2053 - "loc": { 2054 - "end": { 2055 - "column": null, 2056 - "line": 27, 2057 - }, 2058 - "start": { 2059 - "column": 2, 2060 - "line": 14, 2061 - }, 2062 - }, 2063 - "locations": [ 2064 - { 2065 - "end": { 2066 - "column": null, 2067 - "line": 27, 2068 - }, 2069 - "start": { 2070 - "column": 2, 2071 - "line": 14, 2072 - }, 2073 - }, 2074 - { 2075 - "end": { 2076 - "column": null, 2077 - "line": 27, 2078 - }, 2079 - "start": { 2080 - "column": 2, 2081 - "line": 19, 2082 - }, 2083 - }, 2084 - ], 2085 - "type": "if", 2086 - }, 2087 - "3": { 2088 - "loc": { 2089 - "end": { 2090 - "column": 31, 2091 - "line": 16, 2092 - }, 2093 - "start": { 2094 - "column": 11, 2095 - "line": 16, 2096 - }, 2097 - }, 2098 - "locations": [ 2099 - { 2100 - "end": { 2101 - "column": 22, 2102 - "line": 16, 2103 - }, 2104 - "start": { 2105 - "column": 11, 2106 - "line": 16, 2107 - }, 2108 - }, 2109 - { 2110 - "end": { 2111 - "column": 31, 2112 - "line": 16, 2113 - }, 2114 - "start": { 2115 - "column": 22, 2116 - "line": 16, 2117 - }, 2118 - }, 2119 - ], 2120 - "type": "binary-expr", 2121 - }, 2122 - "4": { 2123 - "loc": { 2124 - "end": { 2125 - "column": null, 2126 - "line": 27, 2127 - }, 2128 - "start": { 2129 - "column": 2, 2130 - "line": 19, 2131 - }, 2132 - }, 2133 - "locations": [ 2134 - { 2135 - "end": { 2136 - "column": null, 2137 - "line": 27, 2138 - }, 2139 - "start": { 2140 - "column": 2, 2141 - "line": 19, 2142 - }, 2143 - }, 2144 - { 2145 - "end": { 2146 - "column": null, 2147 - "line": 27, 2148 - }, 2149 - "start": { 2150 - "column": 2, 2151 - "line": 23, 2152 - }, 2153 - }, 2154 - ], 2155 - "type": "if", 2156 - }, 2157 - "5": { 2158 - "loc": { 2159 - "end": { 2160 - "column": 33, 2161 - "line": 20, 2162 - }, 2163 - "start": { 2164 - "column": 11, 2165 - "line": 20, 2166 - }, 2167 - }, 2168 - "locations": [ 2169 - { 2170 - "end": { 2171 - "column": 23, 2172 - "line": 20, 2173 - }, 2174 - "start": { 2175 - "column": 11, 2176 - "line": 20, 2177 - }, 2178 - }, 2179 - { 2180 - "end": { 2181 - "column": 33, 2182 - "line": 20, 2183 - }, 2184 - "start": { 2185 - "column": 23, 2186 - "line": 20, 2187 - }, 2188 - }, 2189 - ], 2190 - "type": "binary-expr", 2191 - }, 2192 - "6": { 2193 - "loc": { 2194 - "end": { 2195 - "column": null, 2196 - "line": 27, 2197 - }, 2198 - "start": { 2199 - "column": 2, 2200 - "line": 23, 2201 - }, 2202 - }, 2203 - "locations": [ 2204 - { 2205 - "end": { 2206 - "column": null, 2207 - "line": 27, 2208 - }, 2209 - "start": { 2210 - "column": 2, 2211 - "line": 23, 2212 - }, 2213 - }, 2214 - { 2215 - "end": { 2216 - "column": null, 2217 - "line": 27, 2218 - }, 2219 - "start": { 2220 - "column": 2, 2221 - "line": 23, 2222 - }, 2223 - }, 2224 - ], 2225 - "type": "if", 2226 - }, 2227 - "7": { 2228 - "loc": { 2229 - "end": { 2230 - "column": 33, 2231 - "line": 24, 2232 - }, 2233 - "start": { 2234 - "column": 11, 2235 - "line": 24, 2236 - }, 2237 - }, 2238 - "locations": [ 2239 - { 2240 - "end": { 2241 - "column": 23, 2242 - "line": 24, 2243 - }, 2244 - "start": { 2245 - "column": 11, 2246 - "line": 24, 2247 - }, 2248 - }, 2249 - { 2250 - "end": { 2251 - "column": 33, 2252 - "line": 24, 2253 - }, 2254 - "start": { 2255 - "column": 23, 2256 - "line": 24, 2257 - }, 2258 - }, 2259 - ], 2260 - "type": "binary-expr", 2261 - }, 2262 - }, 2263 - "f": { 2264 - "0": 4, 2265 - }, 2266 - "fnMap": { 2267 - "0": { 2268 - "decl": { 2269 - "end": { 2270 - "column": 20, 2271 - "line": 6, 2272 - }, 2273 - "start": { 2274 - "column": 16, 2275 - "line": 6, 2276 - }, 2277 - }, 2278 - "loc": { 2279 - "end": { 2280 - "column": null, 2281 - "line": 31, 2282 - }, 2283 - "start": { 2284 - "column": 42, 2285 - "line": 6, 2286 - }, 2287 - }, 2288 - "name": "sum", 2289 - }, 2290 - }, 2291 - "path": "<process-cwd>/src/multi-environment.ts", 2292 - "s": { 2293 - "0": 2, 2294 - "1": 4, 2295 - "2": 0, 2296 - "3": 4, 2297 - "4": 1, 2298 - "5": 3, 2299 - "6": 0, 2300 - "7": 3, 2301 - "8": 1, 2302 - "9": 2, 2303 - }, 2304 - "statementMap": { 2305 - "0": { 2306 - "end": { 2307 - "column": null, 2308 - "line": 4, 2309 - }, 2310 - "start": { 2311 - "column": 23, 2312 - "line": 4, 2313 - }, 2314 - }, 2315 - "1": { 2316 - "end": { 2317 - "column": null, 2318 - "line": 27, 2319 - }, 2320 - "start": { 2321 - "column": 2, 2322 - "line": 11, 2323 - }, 2324 - }, 2325 - "2": { 2326 - "end": { 2327 - "column": null, 2328 - "line": 13, 2329 - }, 2330 - "start": { 2331 - "column": 4, 2332 - "line": 13, 2333 - }, 2334 - }, 2335 - "3": { 2336 - "end": { 2337 - "column": null, 2338 - "line": 27, 2339 - }, 2340 - "start": { 2341 - "column": 2, 2342 - "line": 14, 2343 - }, 2344 - }, 2345 - "4": { 2346 - "end": { 2347 - "column": null, 2348 - "line": 18, 2349 - }, 2350 - "start": { 2351 - "column": 4, 2352 - "line": 18, 2353 - }, 2354 - }, 2355 - "5": { 2356 - "end": { 2357 - "column": null, 2358 - "line": 27, 2359 - }, 2360 - "start": { 2361 - "column": 2, 2362 - "line": 19, 2363 - }, 2364 - }, 2365 - "6": { 2366 - "end": { 2367 - "column": null, 2368 - "line": 22, 2369 - }, 2370 - "start": { 2371 - "column": 4, 2372 - "line": 22, 2373 - }, 2374 - }, 2375 - "7": { 2376 - "end": { 2377 - "column": null, 2378 - "line": 27, 2379 - }, 2380 - "start": { 2381 - "column": 2, 2382 - "line": 23, 2383 - }, 2384 - }, 2385 - "8": { 2386 - "end": { 2387 - "column": null, 2388 - "line": 26, 2389 - }, 2390 - "start": { 2391 - "column": 4, 2392 - "line": 26, 2393 - }, 2394 - }, 2395 - "9": { 2396 - "end": { 2397 - "column": null, 2398 - "line": 30, 2399 - }, 2400 - "start": { 2401 - "column": 2, 2402 - "line": 30, 2403 - }, 2404 - }, 2405 - }, 2406 - }, 2407 - "<process-cwd>/src/multi-suite.ts": { 2408 - "b": {}, 2409 - "branchMap": {}, 2410 - "f": { 2411 - "0": 1, 2412 - "1": 1, 2413 - }, 2414 - "fnMap": { 2415 - "0": { 2416 - "decl": { 2417 - "end": { 2418 - "column": 8, 2419 - "line": 2, 2420 - }, 2421 - "start": { 2422 - "column": 2, 2423 - "line": 2, 2424 - }, 2425 - }, 2426 - "loc": { 2427 - "end": { 2428 - "column": null, 2429 - "line": 4, 2430 - }, 2431 - "start": { 2432 - "column": 21, 2433 - "line": 2, 2434 - }, 2435 - }, 2436 - "name": "(anonymous_0)", 2437 - }, 2438 - "1": { 2439 - "decl": { 2440 - "end": { 2441 - "column": 8, 2442 - "line": 6, 2443 - }, 2444 - "start": { 2445 - "column": 2, 2446 - "line": 6, 2447 - }, 2448 - }, 2449 - "loc": { 2450 - "end": { 2451 - "column": null, 2452 - "line": 8, 2453 - }, 2454 - "start": { 2455 - "column": 21, 2456 - "line": 6, 2457 - }, 2458 - }, 2459 - "name": "(anonymous_1)", 2460 - }, 2461 - }, 2462 - "path": "<process-cwd>/src/multi-suite.ts", 2463 - "s": { 2464 - "0": 1, 2465 - "1": 1, 2466 - }, 2467 - "statementMap": { 2468 - "0": { 2469 - "end": { 2470 - "column": null, 2471 - "line": 3, 2472 - }, 2473 - "start": { 2474 - "column": 4, 2475 - "line": 3, 2476 - }, 2477 - }, 2478 - "1": { 2479 - "end": { 2480 - "column": null, 2481 - "line": 7, 2482 - }, 2483 - "start": { 2484 - "column": 4, 2485 - "line": 7, 2486 - }, 2487 - }, 2488 - }, 2489 - }, 2490 - "<process-cwd>/src/original.ts": { 2491 - "b": { 2492 - "0": [ 2493 - 0, 2494 - 0, 2495 - ], 2496 - "1": [ 2497 - 0, 2498 - 0, 2499 - ], 2500 - "2": [ 2501 - 0, 2502 - 0, 2503 - ], 2504 - "3": [ 2505 - 0, 2506 - 0, 2507 - ], 2508 - "4": [ 2509 - 0, 2510 - 0, 2511 - ], 2512 - "5": [ 2513 - 0, 2514 - 0, 2515 - ], 2516 - }, 2517 - "branchMap": { 2518 - "0": { 2519 - "loc": { 2520 - "end": { 2521 - "column": null, 2522 - "line": 5, 2523 - }, 2524 - "start": { 2525 - "column": 2, 2526 - "line": 2, 2527 - }, 2528 - }, 2529 - "locations": [ 2530 - { 2531 - "end": { 2532 - "column": null, 2533 - "line": 5, 2534 - }, 2535 - "start": { 2536 - "column": 2, 2537 - "line": 2, 2538 - }, 2539 - }, 2540 - { 2541 - "end": { 2542 - "column": null, 2543 - "line": 5, 2544 - }, 2545 - "start": { 2546 - "column": 2, 2547 - "line": 2, 2548 - }, 2549 - }, 2550 - ], 2551 - "type": "if", 2552 - }, 2553 - "1": { 2554 - "loc": { 2555 - "end": { 2556 - "column": null, 2557 - "line": 13, 2558 - }, 2559 - "start": { 2560 - "column": 2, 2561 - "line": 10, 2562 - }, 2563 - }, 2564 - "locations": [ 2565 - { 2566 - "end": { 2567 - "column": null, 2568 - "line": 13, 2569 - }, 2570 - "start": { 2571 - "column": 2, 2572 - "line": 10, 2573 - }, 2574 - }, 2575 - { 2576 - "end": { 2577 - "column": null, 2578 - "line": 13, 2579 - }, 2580 - "start": { 2581 - "column": 2, 2582 - "line": 10, 2583 - }, 2584 - }, 2585 - ], 2586 - "type": "if", 2587 - }, 2588 - "2": { 2589 - "loc": { 2590 - "end": { 2591 - "column": null, 2592 - "line": 18, 2593 - }, 2594 - "start": { 2595 - "column": 2, 2596 - "line": 15, 2597 - }, 2598 - }, 2599 - "locations": [ 2600 - { 2601 - "end": { 2602 - "column": null, 2603 - "line": 18, 2604 - }, 2605 - "start": { 2606 - "column": 2, 2607 - "line": 15, 2608 - }, 2609 - }, 2610 - { 2611 - "end": { 2612 - "column": null, 2613 - "line": 18, 2614 - }, 2615 - "start": { 2616 - "column": 2, 2617 - "line": 15, 2618 - }, 2619 - }, 2620 - ], 2621 - "type": "if", 2622 - }, 2623 - "3": { 2624 - "loc": { 2625 - "end": { 2626 - "column": 3, 2627 - "line": 5, 2628 - }, 2629 - "start": { 2630 - "column": 2, 2631 - "line": 2, 2632 - }, 2633 - }, 2634 - "locations": [ 2635 - { 2636 - "end": { 2637 - "column": 3, 2638 - "line": 5, 2639 - }, 2640 - "start": { 2641 - "column": 2, 2642 - "line": 2, 2643 - }, 2644 - }, 2645 - { 2646 - "end": { 2647 - "column": 3, 2648 - "line": 5, 2649 - }, 2650 - "start": { 2651 - "column": 2, 2652 - "line": 2, 2653 - }, 2654 - }, 2655 - ], 2656 - "type": "if", 2657 - }, 2658 - "4": { 2659 - "loc": { 2660 - "end": { 2661 - "column": 3, 2662 - "line": 13, 2663 - }, 2664 - "start": { 2665 - "column": 2, 2666 - "line": 10, 2667 - }, 2668 - }, 2669 - "locations": [ 2670 - { 2671 - "end": { 2672 - "column": 3, 2673 - "line": 13, 2674 - }, 2675 - "start": { 2676 - "column": 2, 2677 - "line": 10, 2678 - }, 2679 - }, 2680 - { 2681 - "end": { 2682 - "column": 3, 2683 - "line": 13, 2684 - }, 2685 - "start": { 2686 - "column": 2, 2687 - "line": 10, 2688 - }, 2689 - }, 2690 - ], 2691 - "type": "if", 2692 - }, 2693 - "5": { 2694 - "loc": { 2695 - "end": { 2696 - "column": 3, 2697 - "line": 18, 2698 - }, 2699 - "start": { 2700 - "column": 2, 2701 - "line": 15, 2702 - }, 2703 - }, 2704 - "locations": [ 2705 - { 2706 - "end": { 2707 - "column": 3, 2708 - "line": 18, 2709 - }, 2710 - "start": { 2711 - "column": 2, 2712 - "line": 15, 2713 - }, 2714 - }, 2715 - { 2716 - "end": { 2717 - "column": 3, 2718 - "line": 18, 2719 - }, 2720 - "start": { 2721 - "column": 2, 2722 - "line": 15, 2723 - }, 2724 - }, 2725 - ], 2726 - "type": "if", 2727 - }, 2728 - }, 2729 - "f": { 2730 - "0": 0, 2731 - "1": 0, 2732 - "2": 0, 2733 - }, 2734 - "fnMap": { 2735 - "0": { 2736 - "decl": { 2737 - "end": { 2738 - "column": 22, 2739 - "line": 1, 2740 - }, 2741 - "start": { 2742 - "column": 21, 2743 - "line": 1, 2744 - }, 2745 - }, 2746 - "loc": { 2747 - "end": { 2748 - "column": null, 2749 - "line": 19, 2750 - }, 2751 - "start": { 2752 - "column": 40, 2753 - "line": 1, 2754 - }, 2755 - }, 2756 - "name": "(anonymous_0)", 2757 - }, 2758 - "1": { 2759 - "decl": { 2760 - "end": { 2761 - "column": 16, 2762 - "line": 21, 2763 - }, 2764 - "start": { 2765 - "column": 9, 2766 - "line": 21, 2767 - }, 2768 - }, 2769 - "loc": { 2770 - "end": { 2771 - "column": null, 2772 - "line": 21, 2773 - }, 2774 - "start": { 2775 - "column": 16, 2776 - "line": 21, 2777 - }, 2778 - }, 2779 - "name": "noop", 2780 - }, 2781 - "2": { 2782 - "decl": { 2783 - "end": { 2784 - "column": 13, 2785 - "line": 21, 2786 - }, 2787 - "start": { 2788 - "column": 9, 2789 - "line": 21, 2790 - }, 2791 - }, 2792 - "loc": { 2793 - "end": { 2794 - "column": 18, 2795 - "line": 21, 2796 - }, 2797 - "start": { 2798 - "column": 13, 2799 - "line": 21, 2800 - }, 2801 - }, 2802 - "name": "noop", 2803 - }, 2804 - }, 2805 - "path": "<process-cwd>/src/original.ts", 2806 - "s": { 2807 - "0": 0, 2808 - "1": 0, 2809 - "10": 0, 2810 - "11": 0, 2811 - "12": 0, 2812 - "13": 0, 2813 - "14": 0, 2814 - "15": 0, 2815 - "2": 0, 2816 - "3": 0, 2817 - "4": 0, 2818 - "5": 0, 2819 - "6": 0, 2820 - "7": 0, 2821 - "8": 0, 2822 - "9": 0, 2823 - }, 2824 - "statementMap": { 2825 - "0": { 2826 - "end": { 2827 - "column": null, 2828 - "line": 19, 2829 - }, 2830 - "start": { 2831 - "column": 21, 2832 - "line": 1, 2833 - }, 2834 - }, 2835 - "1": { 2836 - "end": { 2837 - "column": null, 2838 - "line": 5, 2839 - }, 2840 - "start": { 2841 - "column": 2, 2842 - "line": 2, 2843 - }, 2844 - }, 2845 - "10": { 2846 - "end": { 2847 - "column": 11, 2848 - "line": 4, 2849 - }, 2850 - "start": { 2851 - "column": 4, 2852 - "line": 4, 2853 - }, 2854 - }, 2855 - "11": { 2856 - "end": { 2857 - "column": 9, 2858 - "line": 8, 2859 - }, 2860 - "start": { 2861 - "column": 2, 2862 - "line": 8, 2863 - }, 2864 - }, 2865 - "12": { 2866 - "end": { 2867 - "column": 3, 2868 - "line": 13, 2869 - }, 2870 - "start": { 2871 - "column": 2, 2872 - "line": 10, 2873 - }, 2874 - }, 2875 - "13": { 2876 - "end": { 2877 - "column": 11, 2878 - "line": 12, 2879 - }, 2880 - "start": { 2881 - "column": 4, 2882 - "line": 12, 2883 - }, 2884 - }, 2885 - "14": { 2886 - "end": { 2887 - "column": 3, 2888 - "line": 18, 2889 - }, 2890 - "start": { 2891 - "column": 2, 2892 - "line": 15, 2893 - }, 2894 - }, 2895 - "15": { 2896 - "end": { 2897 - "column": 11, 2898 - "line": 17, 2899 - }, 2900 - "start": { 2901 - "column": 4, 2902 - "line": 17, 2903 - }, 2904 - }, 2905 - "2": { 2906 - "end": { 2907 - "column": null, 2908 - "line": 4, 2909 - }, 2910 - "start": { 2911 - "column": 4, 2912 - "line": 4, 2913 - }, 2914 - }, 2915 - "3": { 2916 - "end": { 2917 - "column": null, 2918 - "line": 8, 2919 - }, 2920 - "start": { 2921 - "column": 2, 2922 - "line": 8, 2923 - }, 2924 - }, 2925 - "4": { 2926 - "end": { 2927 - "column": null, 2928 - "line": 13, 2929 - }, 2930 - "start": { 2931 - "column": 2, 2932 - "line": 10, 2933 - }, 2934 - }, 2935 - "5": { 2936 - "end": { 2937 - "column": null, 2938 - "line": 12, 2939 - }, 2940 - "start": { 2941 - "column": 4, 2942 - "line": 12, 2943 - }, 2944 - }, 2945 - "6": { 2946 - "end": { 2947 - "column": null, 2948 - "line": 18, 2949 - }, 2950 - "start": { 2951 - "column": 2, 2952 - "line": 15, 2953 - }, 2954 - }, 2955 - "7": { 2956 - "end": { 2957 - "column": null, 2958 - "line": 17, 2959 - }, 2960 - "start": { 2961 - "column": 4, 2962 - "line": 17, 2963 - }, 2964 - }, 2965 - "8": { 2966 - "end": { 2967 - "column": 1, 2968 - "line": 19, 2969 - }, 2970 - "start": { 2971 - "column": 21, 2972 - "line": 1, 2973 - }, 2974 - }, 2975 - "9": { 2976 - "end": { 2977 - "column": 3, 2978 - "line": 5, 2979 - }, 2980 - "start": { 2981 - "column": 2, 2982 - "line": 2, 2983 - }, 2984 - }, 2985 - }, 2986 - }, 2987 - "<process-cwd>/src/untested-file.ts": { 2988 - "b": { 2989 - "0": [ 2990 - 0, 2991 - 0, 2992 - ], 2993 - "1": [ 2994 - 0, 2995 - 0, 2996 - ], 2997 - }, 2998 - "branchMap": { 2999 - "0": { 3000 - "loc": { 3001 - "end": { 3002 - "column": null, 3003 - "line": 36, 3004 - }, 3005 - "start": { 3006 - "column": 2, 3007 - "line": 33, 3008 - }, 3009 - }, 3010 - "locations": [ 3011 - { 3012 - "end": { 3013 - "column": null, 3014 - "line": 36, 3015 - }, 3016 - "start": { 3017 - "column": 2, 3018 - "line": 33, 3019 - }, 3020 - }, 3021 - { 3022 - "end": { 3023 - "column": null, 3024 - "line": 36, 3025 - }, 3026 - "start": { 3027 - "column": 2, 3028 - "line": 33, 3029 - }, 3030 - }, 3031 - ], 3032 - "type": "if", 3033 - }, 3034 - "1": { 3035 - "loc": { 3036 - "end": { 3037 - "column": null, 3038 - "line": 42, 3039 - }, 3040 - "start": { 3041 - "column": 2, 3042 - "line": 39, 3043 - }, 3044 - }, 3045 - "locations": [ 3046 - { 3047 - "end": { 3048 - "column": null, 3049 - "line": 42, 3050 - }, 3051 - "start": { 3052 - "column": 2, 3053 - "line": 39, 3054 - }, 3055 - }, 3056 - { 3057 - "end": { 3058 - "column": null, 3059 - "line": 42, 3060 - }, 3061 - "start": { 3062 - "column": 2, 3063 - "line": 39, 3064 - }, 3065 - }, 3066 - ], 3067 - "type": "if", 3068 - }, 3069 - }, 3070 - "f": { 3071 - "0": 0, 3072 - "1": 0, 3073 - "2": 0, 3074 - "3": 0, 3075 - }, 3076 - "fnMap": { 3077 - "0": { 3078 - "decl": { 3079 - "end": { 3080 - "column": 39, 3081 - "line": 8, 3082 - }, 3083 - "start": { 3084 - "column": 24, 3085 - "line": 8, 3086 - }, 3087 - }, 3088 - "loc": { 3089 - "end": { 3090 - "column": null, 3091 - "line": 10, 3092 - }, 3093 - "start": { 3094 - "column": 39, 3095 - "line": 8, 3096 - }, 3097 - }, 3098 - "name": "untestedFile", 3099 - }, 3100 - "1": { 3101 - "decl": { 3102 - "end": { 3103 - "column": 13, 3104 - "line": 12, 3105 - }, 3106 - "start": { 3107 - "column": 9, 3108 - "line": 12, 3109 - }, 3110 - }, 3111 - "loc": { 3112 - "end": { 3113 - "column": null, 3114 - "line": 15, 3115 - }, 3116 - "start": { 3117 - "column": 35, 3118 - "line": 12, 3119 - }, 3120 - }, 3121 - "name": "add", 3122 - }, 3123 - "2": { 3124 - "decl": { 3125 - "end": { 3126 - "column": 18, 3127 - "line": 19, 3128 - }, 3129 - "start": { 3130 - "column": 9, 3131 - "line": 19, 3132 - }, 3133 - }, 3134 - "loc": { 3135 - "end": { 3136 - "column": null, 3137 - "line": 22, 3138 - }, 3139 - "start": { 3140 - "column": 40, 3141 - "line": 19, 3142 - }, 3143 - }, 3144 - "name": "multiply", 3145 - }, 3146 - "3": { 3147 - "decl": { 3148 - "end": { 3149 - "column": 21, 3150 - "line": 24, 3151 - }, 3152 - "start": { 3153 - "column": 16, 3154 - "line": 24, 3155 - }, 3156 - }, 3157 - "loc": { 3158 - "end": { 3159 - "column": null, 3160 - "line": 47, 3161 - }, 3162 - "start": { 3163 - "column": 64, 3164 - "line": 24, 3165 - }, 3166 - }, 3167 - "name": "math", 3168 - }, 3169 - }, 3170 - "path": "<process-cwd>/src/untested-file.ts", 3171 - "s": { 3172 - "0": 0, 3173 - "1": 0, 3174 - "2": 0, 3175 - "3": 0, 3176 - "4": 0, 3177 - "5": 0, 3178 - "6": 0, 3179 - "7": 0, 3180 - }, 3181 - "statementMap": { 3182 - "0": { 3183 - "end": { 3184 - "column": null, 3185 - "line": 9, 3186 - }, 3187 - "start": { 3188 - "column": 2, 3189 - "line": 9, 3190 - }, 3191 - }, 3192 - "1": { 3193 - "end": { 3194 - "column": null, 3195 - "line": 14, 3196 - }, 3197 - "start": { 3198 - "column": 2, 3199 - "line": 14, 3200 - }, 3201 - }, 3202 - "2": { 3203 - "end": { 3204 - "column": null, 3205 - "line": 21, 3206 - }, 3207 - "start": { 3208 - "column": 2, 3209 - "line": 21, 3210 - }, 3211 - }, 3212 - "3": { 3213 - "end": { 3214 - "column": null, 3215 - "line": 36, 3216 - }, 3217 - "start": { 3218 - "column": 2, 3219 - "line": 33, 3220 - }, 3221 - }, 3222 - "4": { 3223 - "end": { 3224 - "column": null, 3225 - "line": 35, 3226 - }, 3227 - "start": { 3228 - "column": 4, 3229 - "line": 35, 3230 - }, 3231 - }, 3232 - "5": { 3233 - "end": { 3234 - "column": null, 3235 - "line": 42, 3236 - }, 3237 - "start": { 3238 - "column": 2, 3239 - "line": 39, 3240 - }, 3241 - }, 3242 - "6": { 3243 - "end": { 3244 - "column": null, 3245 - "line": 41, 3246 - }, 3247 - "start": { 3248 - "column": 4, 3249 - "line": 41, 3250 - }, 3251 - }, 3252 - "7": { 3253 - "end": { 3254 - "column": null, 3255 - "line": 46, 3256 - }, 3257 - "start": { 3258 - "column": 2, 3259 - "line": 46, 3260 - }, 3261 - }, 3262 - }, 3263 - }, 3264 - "<process-cwd>/src/utils.ts": { 3265 - "b": { 3266 - "0": [ 3267 - 0, 3268 - 1, 3269 - ], 3270 - }, 3271 - "branchMap": { 3272 - "0": { 3273 - "loc": { 3274 - "end": { 3275 - "column": null, 3276 - "line": 17, 3277 - }, 3278 - "start": { 3279 - "column": 2, 3280 - "line": 15, 3281 - }, 3282 - }, 3283 - "locations": [ 3284 - { 3285 - "end": { 3286 - "column": null, 3287 - "line": 17, 3288 - }, 3289 - "start": { 3290 - "column": 2, 3291 - "line": 15, 3292 - }, 3293 - }, 3294 - { 3295 - "end": { 3296 - "column": null, 3297 - "line": 17, 3298 - }, 3299 - "start": { 3300 - "column": 2, 3301 - "line": 15, 3302 - }, 3303 - }, 3304 - ], 3305 - "type": "if", 3306 - }, 3307 - }, 3308 - "f": { 3309 - "0": 1, 3310 - "1": 2, 3311 - "2": 0, 3312 - "3": 1, 3313 - "4": 0, 3314 - }, 3315 - "fnMap": { 3316 - "0": { 3317 - "decl": { 3318 - "end": { 3319 - "column": 20, 3320 - "line": 1, 3321 - }, 3322 - "start": { 3323 - "column": 16, 3324 - "line": 1, 3325 - }, 3326 - }, 3327 - "loc": { 3328 - "end": { 3329 - "column": null, 3330 - "line": 3, 3331 - }, 3332 - "start": { 3333 - "column": 42, 3334 - "line": 1, 3335 - }, 3336 - }, 3337 - "name": "add", 3338 - }, 3339 - "1": { 3340 - "decl": { 3341 - "end": { 3342 - "column": 25, 3343 - "line": 5, 3344 - }, 3345 - "start": { 3346 - "column": 16, 3347 - "line": 5, 3348 - }, 3349 - }, 3350 - "loc": { 3351 - "end": { 3352 - "column": null, 3353 - "line": 7, 3354 - }, 3355 - "start": { 3356 - "column": 47, 3357 - "line": 5, 3358 - }, 3359 - }, 3360 - "name": "multiply", 3361 - }, 3362 - "2": { 3363 - "decl": { 3364 - "end": { 3365 - "column": 23, 3366 - "line": 9, 3367 - }, 3368 - "start": { 3369 - "column": 16, 3370 - "line": 9, 3371 - }, 3372 - }, 3373 - "loc": { 3374 - "end": { 3375 - "column": null, 3376 - "line": 12, 3377 - }, 3378 - "start": { 3379 - "column": 45, 3380 - "line": 9, 3381 - }, 3382 - }, 3383 - "name": "divide", 3384 - }, 3385 - "3": { 3386 - "decl": { 3387 - "end": { 3388 - "column": 21, 3389 - "line": 14, 3390 - }, 3391 - "start": { 3392 - "column": 16, 3393 - "line": 14, 3394 - }, 3395 - }, 3396 - "loc": { 3397 - "end": { 3398 - "column": null, 3399 - "line": 19, 3400 - }, 3401 - "start": { 3402 - "column": 32, 3403 - "line": 14, 3404 - }, 3405 - }, 3406 - "name": "sqrt", 3407 - }, 3408 - "4": { 3409 - "decl": { 3410 - "end": { 3411 - "column": 22, 3412 - "line": 21, 3413 - }, 3414 - "start": { 3415 - "column": 16, 3416 - "line": 21, 3417 - }, 3418 - }, 3419 - "loc": { 3420 - "end": { 3421 - "column": null, 3422 - "line": 24, 3423 - }, 3424 - "start": { 3425 - "column": 22, 3426 - "line": 21, 3427 - }, 3428 - }, 3429 - "name": "run", 3430 - }, 3431 - }, 3432 - "path": "<process-cwd>/src/utils.ts", 3433 - "s": { 3434 - "0": 1, 3435 - "1": 2, 3436 - "2": 0, 3437 - "3": 1, 3438 - "4": 0, 3439 - "5": 1, 3440 - "6": 0, 3441 - }, 3442 - "statementMap": { 3443 - "0": { 3444 - "end": { 3445 - "column": null, 3446 - "line": 2, 3447 - }, 3448 - "start": { 3449 - "column": 2, 3450 - "line": 2, 3451 - }, 3452 - }, 3453 - "1": { 3454 - "end": { 3455 - "column": null, 3456 - "line": 6, 3457 - }, 3458 - "start": { 3459 - "column": 2, 3460 - "line": 6, 3461 - }, 3462 - }, 3463 - "2": { 3464 - "end": { 3465 - "column": null, 3466 - "line": 11, 3467 - }, 3468 - "start": { 3469 - "column": 2, 3470 - "line": 11, 3471 - }, 3472 - }, 3473 - "3": { 3474 - "end": { 3475 - "column": null, 3476 - "line": 17, 3477 - }, 3478 - "start": { 3479 - "column": 2, 3480 - "line": 15, 3481 - }, 3482 - }, 3483 - "4": { 3484 - "end": { 3485 - "column": null, 3486 - "line": 16, 3487 - }, 3488 - "start": { 3489 - "column": 4, 3490 - "line": 16, 3491 - }, 3492 - }, 3493 - "5": { 3494 - "end": { 3495 - "column": null, 3496 - "line": 18, 3497 - }, 3498 - "start": { 3499 - "column": 2, 3500 - "line": 18, 3501 - }, 3502 - }, 3503 - "6": { 3504 - "end": { 3505 - "column": null, 3506 - "line": 23, 3507 - }, 3508 - "start": { 3509 - "column": 2, 3510 - "line": 23, 3511 - }, 3512 - }, 3513 - }, 3514 - }, 3515 - } 3516 - `;
-5087
test/coverage-test/coverage-report-tests/__snapshots__/v8.report.test.ts.snap
··· 1 - // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html 2 - 3 - exports[`v8 json report 1`] = ` 4 - { 5 - "<process-cwd>/src/Counter/Counter.component.ts": { 6 - "all": false, 7 - "b": { 8 - "0": [ 9 - 1, 10 - ], 11 - "1": [ 12 - 2, 13 - ], 14 - }, 15 - "branchMap": { 16 - "0": { 17 - "line": 6, 18 - "loc": { 19 - "end": { 20 - "column": 4, 21 - "line": 9, 22 - }, 23 - "start": { 24 - "column": 2, 25 - "line": 6, 26 - }, 27 - }, 28 - "locations": [ 29 - { 30 - "end": { 31 - "column": 4, 32 - "line": 9, 33 - }, 34 - "start": { 35 - "column": 2, 36 - "line": 6, 37 - }, 38 - }, 39 - ], 40 - "type": "branch", 41 - }, 42 - "1": { 43 - "line": 16, 44 - "loc": { 45 - "end": { 46 - "column": 6, 47 - "line": 18, 48 - }, 49 - "start": { 50 - "column": 4, 51 - "line": 16, 52 - }, 53 - }, 54 - "locations": [ 55 - { 56 - "end": { 57 - "column": 6, 58 - "line": 18, 59 - }, 60 - "start": { 61 - "column": 4, 62 - "line": 16, 63 - }, 64 - }, 65 - ], 66 - "type": "branch", 67 - }, 68 - }, 69 - "f": { 70 - "0": 1, 71 - "1": 0, 72 - "2": 2, 73 - "3": 0, 74 - }, 75 - "fnMap": { 76 - "0": { 77 - "decl": { 78 - "end": { 79 - "column": 4, 80 - "line": 9, 81 - }, 82 - "start": { 83 - "column": 2, 84 - "line": 6, 85 - }, 86 - }, 87 - "line": 6, 88 - "loc": { 89 - "end": { 90 - "column": 4, 91 - "line": 9, 92 - }, 93 - "start": { 94 - "column": 2, 95 - "line": 6, 96 - }, 97 - }, 98 - "name": "setup", 99 - }, 100 - "1": { 101 - "decl": { 102 - "end": { 103 - "column": 6, 104 - "line": 14, 105 - }, 106 - "start": { 107 - "column": 4, 108 - "line": 12, 109 - }, 110 - }, 111 - "line": 12, 112 - "loc": { 113 - "end": { 114 - "column": 6, 115 - "line": 14, 116 - }, 117 - "start": { 118 - "column": 4, 119 - "line": 12, 120 - }, 121 - }, 122 - "name": "uncoveredMethod", 123 - }, 124 - "2": { 125 - "decl": { 126 - "end": { 127 - "column": 6, 128 - "line": 18, 129 - }, 130 - "start": { 131 - "column": 4, 132 - "line": 16, 133 - }, 134 - }, 135 - "line": 16, 136 - "loc": { 137 - "end": { 138 - "column": 6, 139 - "line": 18, 140 - }, 141 - "start": { 142 - "column": 4, 143 - "line": 16, 144 - }, 145 - }, 146 - "name": "coveredMethod", 147 - }, 148 - "3": { 149 - "decl": { 150 - "end": { 151 - "column": 6, 152 - "line": 22, 153 - }, 154 - "start": { 155 - "column": 4, 156 - "line": 20, 157 - }, 158 - }, 159 - "line": 20, 160 - "loc": { 161 - "end": { 162 - "column": 6, 163 - "line": 22, 164 - }, 165 - "start": { 166 - "column": 4, 167 - "line": 20, 168 - }, 169 - }, 170 - "name": "uncoveredMethodUsingImportMeta", 171 - }, 172 - }, 173 - "path": "<process-cwd>/src/Counter/Counter.component.ts", 174 - "s": { 175 - "0": 1, 176 - "10": 1, 177 - "11": 1, 178 - "12": 0, 179 - "13": 0, 180 - "15": 1, 181 - "16": 2, 182 - "17": 2, 183 - "19": 1, 184 - "2": 1, 185 - "20": 0, 186 - "21": 0, 187 - "22": 1, 188 - "23": 1, 189 - "3": 1, 190 - "5": 1, 191 - "6": 1, 192 - "7": 1, 193 - "8": 1, 194 - }, 195 - "statementMap": { 196 - "0": { 197 - "end": { 198 - "column": 42, 199 - "line": 1, 200 - }, 201 - "start": { 202 - "column": 0, 203 - "line": 1, 204 - }, 205 - }, 206 - "10": { 207 - "end": { 208 - "column": 12, 209 - "line": 11, 210 - }, 211 - "start": { 212 - "column": 0, 213 - "line": 11, 214 - }, 215 - }, 216 - "11": { 217 - "end": { 218 - "column": 23, 219 - "line": 12, 220 - }, 221 - "start": { 222 - "column": 0, 223 - "line": 12, 224 - }, 225 - }, 226 - "12": { 227 - "end": { 228 - "column": 46, 229 - "line": 13, 230 - }, 231 - "start": { 232 - "column": 0, 233 - "line": 13, 234 - }, 235 - }, 236 - "13": { 237 - "end": { 238 - "column": 6, 239 - "line": 14, 240 - }, 241 - "start": { 242 - "column": 0, 243 - "line": 14, 244 - }, 245 - }, 246 - "15": { 247 - "end": { 248 - "column": 21, 249 - "line": 16, 250 - }, 251 - "start": { 252 - "column": 0, 253 - "line": 16, 254 - }, 255 - }, 256 - "16": { 257 - "end": { 258 - "column": 42, 259 - "line": 17, 260 - }, 261 - "start": { 262 - "column": 0, 263 - "line": 17, 264 - }, 265 - }, 266 - "17": { 267 - "end": { 268 - "column": 6, 269 - "line": 18, 270 - }, 271 - "start": { 272 - "column": 0, 273 - "line": 18, 274 - }, 275 - }, 276 - "19": { 277 - "end": { 278 - "column": 38, 279 - "line": 20, 280 - }, 281 - "start": { 282 - "column": 0, 283 - "line": 20, 284 - }, 285 - }, 286 - "2": { 287 - "end": { 288 - "column": 32, 289 - "line": 3, 290 - }, 291 - "start": { 292 - "column": 0, 293 - "line": 3, 294 - }, 295 - }, 296 - "20": { 297 - "end": { 298 - "column": 94, 299 - "line": 21, 300 - }, 301 - "start": { 302 - "column": 0, 303 - "line": 21, 304 - }, 305 - }, 306 - "21": { 307 - "end": { 308 - "column": 6, 309 - "line": 22, 310 - }, 311 - "start": { 312 - "column": 0, 313 - "line": 22, 314 - }, 315 - }, 316 - "22": { 317 - "end": { 318 - "column": 4, 319 - "line": 23, 320 - }, 321 - "start": { 322 - "column": 0, 323 - "line": 23, 324 - }, 325 - }, 326 - "23": { 327 - "end": { 328 - "column": 2, 329 - "line": 24, 330 - }, 331 - "start": { 332 - "column": 0, 333 - "line": 24, 334 - }, 335 - }, 336 - "3": { 337 - "end": { 338 - "column": 18, 339 - "line": 4, 340 - }, 341 - "start": { 342 - "column": 0, 343 - "line": 4, 344 - }, 345 - }, 346 - "5": { 347 - "end": { 348 - "column": 11, 349 - "line": 6, 350 - }, 351 - "start": { 352 - "column": 0, 353 - "line": 6, 354 - }, 355 - }, 356 - "6": { 357 - "end": { 358 - "column": 24, 359 - "line": 7, 360 - }, 361 - "start": { 362 - "column": 0, 363 - "line": 7, 364 - }, 365 - }, 366 - "7": { 367 - "end": { 368 - "column": 20, 369 - "line": 8, 370 - }, 371 - "start": { 372 - "column": 0, 373 - "line": 8, 374 - }, 375 - }, 376 - "8": { 377 - "end": { 378 - "column": 4, 379 - "line": 9, 380 - }, 381 - "start": { 382 - "column": 0, 383 - "line": 9, 384 - }, 385 - }, 386 - }, 387 - }, 388 - "<process-cwd>/src/Counter/Counter.vue": { 389 - "all": false, 390 - "b": { 391 - "0": [ 392 - 1, 393 - ], 394 - "1": [ 395 - 1, 396 - ], 397 - }, 398 - "branchMap": { 399 - "0": { 400 - "line": 8, 401 - "loc": { 402 - "end": { 403 - "column": 25, 404 - "line": 8, 405 - }, 406 - "start": { 407 - "column": 18, 408 - "line": 8, 409 - }, 410 - }, 411 - "locations": [ 412 - { 413 - "end": { 414 - "column": 25, 415 - "line": 8, 416 - }, 417 - "start": { 418 - "column": 18, 419 - "line": 8, 420 - }, 421 - }, 422 - ], 423 - "type": "branch", 424 - }, 425 - "1": { 426 - "line": 8, 427 - "loc": { 428 - "end": { 429 - "column": 25, 430 - "line": 8, 431 - }, 432 - "start": { 433 - "column": 18, 434 - "line": 8, 435 - }, 436 - }, 437 - "locations": [ 438 - { 439 - "end": { 440 - "column": 25, 441 - "line": 8, 442 - }, 443 - "start": { 444 - "column": 18, 445 - "line": 8, 446 - }, 447 - }, 448 - ], 449 - "type": "branch", 450 - }, 451 - }, 452 - "f": { 453 - "0": 1, 454 - }, 455 - "fnMap": { 456 - "0": { 457 - "decl": { 458 - "end": { 459 - "column": 25, 460 - "line": 8, 461 - }, 462 - "start": { 463 - "column": 18, 464 - "line": 8, 465 - }, 466 - }, 467 - "line": 8, 468 - "loc": { 469 - "end": { 470 - "column": 25, 471 - "line": 8, 472 - }, 473 - "start": { 474 - "column": 18, 475 - "line": 8, 476 - }, 477 - }, 478 - "name": "__vite_ssr_import_1__.createElementBlock.__vite_ssr_import_1__.createElementVNode.onClick._cache.<computed>._cache.<computed>", 479 - }, 480 - }, 481 - "path": "<process-cwd>/src/Counter/Counter.vue", 482 - "s": { 483 - "0": 1, 484 - "3": 1, 485 - "4": 1, 486 - "5": 1, 487 - "7": 1, 488 - "9": 1, 489 - }, 490 - "statementMap": { 491 - "0": { 492 - "end": { 493 - "column": 56, 494 - "line": 1, 495 - }, 496 - "start": { 497 - "column": 0, 498 - "line": 1, 499 - }, 500 - }, 501 - "3": { 502 - "end": { 503 - "column": 27, 504 - "line": 4, 505 - }, 506 - "start": { 507 - "column": 0, 508 - "line": 4, 509 - }, 510 - }, 511 - "4": { 512 - "end": { 513 - "column": 15, 514 - "line": 5, 515 - }, 516 - "start": { 517 - "column": 0, 518 - "line": 5, 519 - }, 520 - }, 521 - "5": { 522 - "end": { 523 - "column": 11, 524 - "line": 6, 525 - }, 526 - "start": { 527 - "column": 0, 528 - "line": 6, 529 - }, 530 - }, 531 - "7": { 532 - "end": { 533 - "column": 25, 534 - "line": 8, 535 - }, 536 - "start": { 537 - "column": 0, 538 - "line": 8, 539 - }, 540 - }, 541 - "9": { 542 - "end": { 543 - "column": 8, 544 - "line": 10, 545 - }, 546 - "start": { 547 - "column": 0, 548 - "line": 10, 549 - }, 550 - }, 551 - }, 552 - }, 553 - "<process-cwd>/src/Counter/index.ts": { 554 - "all": false, 555 - "b": {}, 556 - "branchMap": {}, 557 - "f": {}, 558 - "fnMap": {}, 559 - "path": "<process-cwd>/src/Counter/index.ts", 560 - "s": { 561 - "0": 1, 562 - }, 563 - "statementMap": { 564 - "0": { 565 - "end": { 566 - "column": 38, 567 - "line": 1, 568 - }, 569 - "start": { 570 - "column": 0, 571 - "line": 1, 572 - }, 573 - }, 574 - }, 575 - }, 576 - "<process-cwd>/src/Defined.vue": { 577 - "all": false, 578 - "b": { 579 - "0": [ 580 - 0, 581 - ], 582 - }, 583 - "branchMap": { 584 - "0": { 585 - "line": 7, 586 - "loc": { 587 - "end": { 588 - "column": 1, 589 - "line": 10, 590 - }, 591 - "start": { 592 - "column": 0, 593 - "line": 7, 594 - }, 595 - }, 596 - "locations": [ 597 - { 598 - "end": { 599 - "column": 1, 600 - "line": 10, 601 - }, 602 - "start": { 603 - "column": 0, 604 - "line": 7, 605 - }, 606 - }, 607 - ], 608 - "type": "branch", 609 - }, 610 - }, 611 - "f": {}, 612 - "fnMap": {}, 613 - "path": "<process-cwd>/src/Defined.vue", 614 - "s": { 615 - "0": 1, 616 - "1": 1, 617 - "13": 1, 618 - "4": 1, 619 - "5": 1, 620 - "6": 0, 621 - "7": 0, 622 - "8": 0, 623 - "9": 0, 624 - }, 625 - "statementMap": { 626 - "0": { 627 - "end": { 628 - "column": 24, 629 - "line": 1, 630 - }, 631 - "start": { 632 - "column": 0, 633 - "line": 1, 634 - }, 635 - }, 636 - "1": { 637 - "end": { 638 - "column": 27, 639 - "line": 2, 640 - }, 641 - "start": { 642 - "column": 0, 643 - "line": 2, 644 - }, 645 - }, 646 - "13": { 647 - "end": { 648 - "column": 15, 649 - "line": 14, 650 - }, 651 - "start": { 652 - "column": 0, 653 - "line": 14, 654 - }, 655 - }, 656 - "4": { 657 - "end": { 658 - "column": 14, 659 - "line": 5, 660 - }, 661 - "start": { 662 - "column": 0, 663 - "line": 5, 664 - }, 665 - }, 666 - "5": { 667 - "end": { 668 - "column": 34, 669 - "line": 6, 670 - }, 671 - "start": { 672 - "column": 0, 673 - "line": 6, 674 - }, 675 - }, 676 - "6": { 677 - "end": { 678 - "column": 1, 679 - "line": 7, 680 - }, 681 - "start": { 682 - "column": 0, 683 - "line": 7, 684 - }, 685 - }, 686 - "7": { 687 - "end": { 688 - "column": 6, 689 - "line": 8, 690 - }, 691 - "start": { 692 - "column": 0, 693 - "line": 8, 694 - }, 695 - }, 696 - "8": { 697 - "end": { 698 - "column": 36, 699 - "line": 9, 700 - }, 701 - "start": { 702 - "column": 0, 703 - "line": 9, 704 - }, 705 - }, 706 - "9": { 707 - "end": { 708 - "column": 1, 709 - "line": 10, 710 - }, 711 - "start": { 712 - "column": 0, 713 - "line": 10, 714 - }, 715 - }, 716 - }, 717 - }, 718 - "<process-cwd>/src/Hello.vue": { 719 - "all": false, 720 - "b": { 721 - "0": [ 722 - 3, 723 - ], 724 - }, 725 - "branchMap": { 726 - "0": { 727 - "line": 7, 728 - "loc": { 729 - "end": { 730 - "column": 55, 731 - "line": 7, 732 - }, 733 - "start": { 734 - "column": 24, 735 - "line": 7, 736 - }, 737 - }, 738 - "locations": [ 739 - { 740 - "end": { 741 - "column": 55, 742 - "line": 7, 743 - }, 744 - "start": { 745 - "column": 24, 746 - "line": 7, 747 - }, 748 - }, 749 - ], 750 - "type": "branch", 751 - }, 752 - }, 753 - "f": {}, 754 - "fnMap": {}, 755 - "path": "<process-cwd>/src/Hello.vue", 756 - "s": { 757 - "0": 1, 758 - "1": 1, 759 - "12": 1, 760 - "13": 1, 761 - "15": 1, 762 - "3": 1, 763 - "5": 1, 764 - "6": 1, 765 - "8": 1, 766 - }, 767 - "statementMap": { 768 - "0": { 769 - "end": { 770 - "column": 24, 771 - "line": 1, 772 - }, 773 - "start": { 774 - "column": 0, 775 - "line": 1, 776 - }, 777 - }, 778 - "1": { 779 - "end": { 780 - "column": 35, 781 - "line": 2, 782 - }, 783 - "start": { 784 - "column": 0, 785 - "line": 2, 786 - }, 787 - }, 788 - "12": { 789 - "end": { 790 - "column": 53, 791 - "line": 13, 792 - }, 793 - "start": { 794 - "column": 0, 795 - "line": 13, 796 - }, 797 - }, 798 - "13": { 799 - "end": { 800 - "column": 30, 801 - "line": 14, 802 - }, 803 - "start": { 804 - "column": 0, 805 - "line": 14, 806 - }, 807 - }, 808 - "15": { 809 - "end": { 810 - "column": 11, 811 - "line": 16, 812 - }, 813 - "start": { 814 - "column": 0, 815 - "line": 16, 816 - }, 817 - }, 818 - "3": { 819 - "end": { 820 - "column": 46, 821 - "line": 4, 822 - }, 823 - "start": { 824 - "column": 0, 825 - "line": 4, 826 - }, 827 - }, 828 - "5": { 829 - "end": { 830 - "column": 20, 831 - "line": 6, 832 - }, 833 - "start": { 834 - "column": 0, 835 - "line": 6, 836 - }, 837 - }, 838 - "6": { 839 - "end": { 840 - "column": 56, 841 - "line": 7, 842 - }, 843 - "start": { 844 - "column": 0, 845 - "line": 7, 846 - }, 847 - }, 848 - "8": { 849 - "end": { 850 - "column": 19, 851 - "line": 9, 852 - }, 853 - "start": { 854 - "column": 0, 855 - "line": 9, 856 - }, 857 - }, 858 - }, 859 - }, 860 - "<process-cwd>/src/decorators.ts": { 861 - "all": false, 862 - "b": { 863 - "0": [ 864 - 1, 865 - ], 866 - "1": [ 867 - 0, 868 - ], 869 - "2": [ 870 - 1, 871 - ], 872 - "3": [ 873 - 1, 874 - ], 875 - }, 876 - "branchMap": { 877 - "0": { 878 - "line": 4, 879 - "loc": { 880 - "end": { 881 - "column": 3, 882 - "line": 14, 883 - }, 884 - "start": { 885 - "column": 2, 886 - "line": 4, 887 - }, 888 - }, 889 - "locations": [ 890 - { 891 - "end": { 892 - "column": 3, 893 - "line": 14, 894 - }, 895 - "start": { 896 - "column": 2, 897 - "line": 4, 898 - }, 899 - }, 900 - ], 901 - "type": "branch", 902 - }, 903 - "1": { 904 - "line": 10, 905 - "loc": { 906 - "end": { 907 - "column": 5, 908 - "line": 13, 909 - }, 910 - "start": { 911 - "column": 35, 912 - "line": 10, 913 - }, 914 - }, 915 - "locations": [ 916 - { 917 - "end": { 918 - "column": 5, 919 - "line": 13, 920 - }, 921 - "start": { 922 - "column": 35, 923 - "line": 10, 924 - }, 925 - }, 926 - ], 927 - "type": "branch", 928 - }, 929 - "2": { 930 - "line": 17, 931 - "loc": { 932 - "end": { 933 - "column": 4, 934 - "line": 21, 935 - }, 936 - "start": { 937 - "column": 0, 938 - "line": 17, 939 - }, 940 - }, 941 - "locations": [ 942 - { 943 - "end": { 944 - "column": 4, 945 - "line": 21, 946 - }, 947 - "start": { 948 - "column": 0, 949 - "line": 17, 950 - }, 951 - }, 952 - ], 953 - "type": "branch", 954 - }, 955 - "3": { 956 - "line": 25, 957 - "loc": { 958 - "end": { 959 - "column": 1, 960 - "line": 27, 961 - }, 962 - "start": { 963 - "column": 0, 964 - "line": 25, 965 - }, 966 - }, 967 - "locations": [ 968 - { 969 - "end": { 970 - "column": 1, 971 - "line": 27, 972 - }, 973 - "start": { 974 - "column": 0, 975 - "line": 25, 976 - }, 977 - }, 978 - ], 979 - "type": "branch", 980 - }, 981 - }, 982 - "f": { 983 - "0": 1, 984 - "1": 1, 985 - "2": 1, 986 - }, 987 - "fnMap": { 988 - "0": { 989 - "decl": { 990 - "end": { 991 - "column": 3, 992 - "line": 14, 993 - }, 994 - "start": { 995 - "column": 2, 996 - "line": 4, 997 - }, 998 - }, 999 - "line": 4, 1000 - "loc": { 1001 - "end": { 1002 - "column": 3, 1003 - "line": 14, 1004 - }, 1005 - "start": { 1006 - "column": 2, 1007 - "line": 4, 1008 - }, 1009 - }, 1010 - "name": "method", 1011 - }, 1012 - "1": { 1013 - "decl": { 1014 - "end": { 1015 - "column": 4, 1016 - "line": 21, 1017 - }, 1018 - "start": { 1019 - "column": 0, 1020 - "line": 17, 1021 - }, 1022 - }, 1023 - "line": 17, 1024 - "loc": { 1025 - "end": { 1026 - "column": 4, 1027 - "line": 21, 1028 - }, 1029 - "start": { 1030 - "column": 0, 1031 - "line": 17, 1032 - }, 1033 - }, 1034 - "name": "SomeDecorator", 1035 - }, 1036 - "2": { 1037 - "decl": { 1038 - "end": { 1039 - "column": 1, 1040 - "line": 27, 1041 - }, 1042 - "start": { 1043 - "column": 0, 1044 - "line": 25, 1045 - }, 1046 - }, 1047 - "line": 25, 1048 - "loc": { 1049 - "end": { 1050 - "column": 1, 1051 - "line": 27, 1052 - }, 1053 - "start": { 1054 - "column": 0, 1055 - "line": 25, 1056 - }, 1057 - }, 1058 - "name": "noop", 1059 - }, 1060 - }, 1061 - "path": "<process-cwd>/src/decorators.ts", 1062 - "s": { 1063 - "0": 1, 1064 - "11": 0, 1065 - "12": 0, 1066 - "13": 1, 1067 - "14": 1, 1068 - "16": 1, 1069 - "17": 1, 1070 - "18": 1, 1071 - "19": 1, 1072 - "2": 1, 1073 - "20": 1, 1074 - "24": 1, 1075 - "26": 1, 1076 - "3": 1, 1077 - "4": 1, 1078 - "6": 1, 1079 - "7": 1, 1080 - "9": 1, 1081 - }, 1082 - "statementMap": { 1083 - "0": { 1084 - "end": { 1085 - "column": 85, 1086 - "line": 1, 1087 - }, 1088 - "start": { 1089 - "column": 0, 1090 - "line": 1, 1091 - }, 1092 - }, 1093 - "11": { 1094 - "end": { 1095 - "column": 21, 1096 - "line": 12, 1097 - }, 1098 - "start": { 1099 - "column": 0, 1100 - "line": 12, 1101 - }, 1102 - }, 1103 - "12": { 1104 - "end": { 1105 - "column": 5, 1106 - "line": 13, 1107 - }, 1108 - "start": { 1109 - "column": 0, 1110 - "line": 13, 1111 - }, 1112 - }, 1113 - "13": { 1114 - "end": { 1115 - "column": 3, 1116 - "line": 14, 1117 - }, 1118 - "start": { 1119 - "column": 0, 1120 - "line": 14, 1121 - }, 1122 - }, 1123 - "14": { 1124 - "end": { 1125 - "column": 1, 1126 - "line": 15, 1127 - }, 1128 - "start": { 1129 - "column": 0, 1130 - "line": 15, 1131 - }, 1132 - }, 1133 - "16": { 1134 - "end": { 1135 - "column": 23, 1136 - "line": 17, 1137 - }, 1138 - "start": { 1139 - "column": 0, 1140 - "line": 17, 1141 - }, 1142 - }, 1143 - "17": { 1144 - "end": { 1145 - "column": 18, 1146 - "line": 18, 1147 - }, 1148 - "start": { 1149 - "column": 0, 1150 - "line": 18, 1151 - }, 1152 - }, 1153 - "18": { 1154 - "end": { 1155 - "column": 32, 1156 - "line": 19, 1157 - }, 1158 - "start": { 1159 - "column": 0, 1160 - "line": 19, 1161 - }, 1162 - }, 1163 - "19": { 1164 - "end": { 1165 - "column": 26, 1166 - "line": 20, 1167 - }, 1168 - "start": { 1169 - "column": 0, 1170 - "line": 20, 1171 - }, 1172 - }, 1173 - "2": { 1174 - "end": { 1175 - "column": 31, 1176 - "line": 3, 1177 - }, 1178 - "start": { 1179 - "column": 0, 1180 - "line": 3, 1181 - }, 1182 - }, 1183 - "20": { 1184 - "end": { 1185 - "column": 4, 1186 - "line": 21, 1187 - }, 1188 - "start": { 1189 - "column": 0, 1190 - "line": 21, 1191 - }, 1192 - }, 1193 - "24": { 1194 - "end": { 1195 - "column": 36, 1196 - "line": 25, 1197 - }, 1198 - "start": { 1199 - "column": 0, 1200 - "line": 25, 1201 - }, 1202 - }, 1203 - "26": { 1204 - "end": { 1205 - "column": 1, 1206 - "line": 27, 1207 - }, 1208 - "start": { 1209 - "column": 0, 1210 - "line": 27, 1211 - }, 1212 - }, 1213 - "3": { 1214 - "end": { 1215 - "column": 47, 1216 - "line": 4, 1217 - }, 1218 - "start": { 1219 - "column": 0, 1220 - "line": 4, 1221 - }, 1222 - }, 1223 - "4": { 1224 - "end": { 1225 - "column": 20, 1226 - "line": 5, 1227 - }, 1228 - "start": { 1229 - "column": 0, 1230 - "line": 5, 1231 - }, 1232 - }, 1233 - "6": { 1234 - "end": { 1235 - "column": 21, 1236 - "line": 7, 1237 - }, 1238 - "start": { 1239 - "column": 0, 1240 - "line": 7, 1241 - }, 1242 - }, 1243 - "7": { 1244 - "end": { 1245 - "column": 5, 1246 - "line": 8, 1247 - }, 1248 - "start": { 1249 - "column": 0, 1250 - "line": 8, 1251 - }, 1252 - }, 1253 - "9": { 1254 - "end": { 1255 - "column": 36, 1256 - "line": 10, 1257 - }, 1258 - "start": { 1259 - "column": 0, 1260 - "line": 10, 1261 - }, 1262 - }, 1263 - }, 1264 - }, 1265 - "<process-cwd>/src/dynamic-file-cjs.ignore.cjs": { 1266 - "all": false, 1267 - "b": { 1268 - "0": [ 1269 - 1, 1270 - ], 1271 - "1": [ 1272 - 1, 1273 - ], 1274 - }, 1275 - "branchMap": { 1276 - "0": { 1277 - "line": 1, 1278 - "loc": { 1279 - "end": { 1280 - "column": 141, 1281 - "line": 1, 1282 - }, 1283 - "start": { 1284 - "column": 0, 1285 - "line": 1, 1286 - }, 1287 - }, 1288 - "locations": [ 1289 - { 1290 - "end": { 1291 - "column": 141, 1292 - "line": 1, 1293 - }, 1294 - "start": { 1295 - "column": 0, 1296 - "line": 1, 1297 - }, 1298 - }, 1299 - ], 1300 - "type": "branch", 1301 - }, 1302 - "1": { 1303 - "line": 1, 1304 - "loc": { 1305 - "end": { 1306 - "column": 117, 1307 - "line": 1, 1308 - }, 1309 - "start": { 1310 - "column": 75, 1311 - "line": 1, 1312 - }, 1313 - }, 1314 - "locations": [ 1315 - { 1316 - "end": { 1317 - "column": 117, 1318 - "line": 1, 1319 - }, 1320 - "start": { 1321 - "column": 75, 1322 - "line": 1, 1323 - }, 1324 - }, 1325 - ], 1326 - "type": "branch", 1327 - }, 1328 - }, 1329 - "f": { 1330 - "0": 1, 1331 - "1": 0, 1332 - }, 1333 - "fnMap": { 1334 - "0": { 1335 - "decl": { 1336 - "end": { 1337 - "column": 117, 1338 - "line": 1, 1339 - }, 1340 - "start": { 1341 - "column": 75, 1342 - "line": 1, 1343 - }, 1344 - }, 1345 - "line": 1, 1346 - "loc": { 1347 - "end": { 1348 - "column": 117, 1349 - "line": 1, 1350 - }, 1351 - "start": { 1352 - "column": 75, 1353 - "line": 1, 1354 - }, 1355 - }, 1356 - "name": "run", 1357 - }, 1358 - "1": { 1359 - "decl": { 1360 - "end": { 1361 - "column": 141, 1362 - "line": 1, 1363 - }, 1364 - "start": { 1365 - "column": 118, 1366 - "line": 1, 1367 - }, 1368 - }, 1369 - "line": 1, 1370 - "loc": { 1371 - "end": { 1372 - "column": 141, 1373 - "line": 1, 1374 - }, 1375 - "start": { 1376 - "column": 118, 1377 - "line": 1, 1378 - }, 1379 - }, 1380 - "name": "uncovered", 1381 - }, 1382 - }, 1383 - "path": "<process-cwd>/src/dynamic-file-cjs.ignore.cjs", 1384 - "s": { 1385 - "0": 1, 1386 - }, 1387 - "statementMap": { 1388 - "0": { 1389 - "end": { 1390 - "column": 141, 1391 - "line": 1, 1392 - }, 1393 - "start": { 1394 - "column": 0, 1395 - "line": 1, 1396 - }, 1397 - }, 1398 - }, 1399 - }, 1400 - "<process-cwd>/src/dynamic-file-esm.ignore.js": { 1401 - "all": false, 1402 - "b": { 1403 - "0": [ 1404 - 1, 1405 - ], 1406 - }, 1407 - "branchMap": { 1408 - "0": { 1409 - "line": 2, 1410 - "loc": { 1411 - "end": { 1412 - "column": 1, 1413 - "line": 4, 1414 - }, 1415 - "start": { 1416 - "column": 7, 1417 - "line": 2, 1418 - }, 1419 - }, 1420 - "locations": [ 1421 - { 1422 - "end": { 1423 - "column": 1, 1424 - "line": 4, 1425 - }, 1426 - "start": { 1427 - "column": 7, 1428 - "line": 2, 1429 - }, 1430 - }, 1431 - ], 1432 - "type": "branch", 1433 - }, 1434 - }, 1435 - "f": { 1436 - "0": 1, 1437 - "1": 0, 1438 - }, 1439 - "fnMap": { 1440 - "0": { 1441 - "decl": { 1442 - "end": { 1443 - "column": 1, 1444 - "line": 4, 1445 - }, 1446 - "start": { 1447 - "column": 7, 1448 - "line": 2, 1449 - }, 1450 - }, 1451 - "line": 2, 1452 - "loc": { 1453 - "end": { 1454 - "column": 1, 1455 - "line": 4, 1456 - }, 1457 - "start": { 1458 - "column": 7, 1459 - "line": 2, 1460 - }, 1461 - }, 1462 - "name": "run", 1463 - }, 1464 - "1": { 1465 - "decl": { 1466 - "end": { 1467 - "column": 23, 1468 - "line": 5, 1469 - }, 1470 - "start": { 1471 - "column": 0, 1472 - "line": 5, 1473 - }, 1474 - }, 1475 - "line": 5, 1476 - "loc": { 1477 - "end": { 1478 - "column": 23, 1479 - "line": 5, 1480 - }, 1481 - "start": { 1482 - "column": 0, 1483 - "line": 5, 1484 - }, 1485 - }, 1486 - "name": "uncovered", 1487 - }, 1488 - }, 1489 - "path": "<process-cwd>/src/dynamic-file-esm.ignore.js", 1490 - "s": { 1491 - "0": 1, 1492 - "1": 1, 1493 - "2": 1, 1494 - "3": 1, 1495 - "4": 0, 1496 - }, 1497 - "statementMap": { 1498 - "0": { 1499 - "end": { 1500 - "column": 53, 1501 - "line": 1, 1502 - }, 1503 - "start": { 1504 - "column": 0, 1505 - "line": 1, 1506 - }, 1507 - }, 1508 - "1": { 1509 - "end": { 1510 - "column": 23, 1511 - "line": 2, 1512 - }, 1513 - "start": { 1514 - "column": 0, 1515 - "line": 2, 1516 - }, 1517 - }, 1518 - "2": { 1519 - "end": { 1520 - "column": 23, 1521 - "line": 3, 1522 - }, 1523 - "start": { 1524 - "column": 0, 1525 - "line": 3, 1526 - }, 1527 - }, 1528 - "3": { 1529 - "end": { 1530 - "column": 1, 1531 - "line": 4, 1532 - }, 1533 - "start": { 1534 - "column": 0, 1535 - "line": 4, 1536 - }, 1537 - }, 1538 - "4": { 1539 - "end": { 1540 - "column": 23, 1541 - "line": 5, 1542 - }, 1543 - "start": { 1544 - "column": 0, 1545 - "line": 5, 1546 - }, 1547 - }, 1548 - }, 1549 - }, 1550 - "<process-cwd>/src/dynamic-files.ts": { 1551 - "all": false, 1552 - "b": { 1553 - "0": [ 1554 - 1, 1555 - ], 1556 - "1": [ 1557 - 0, 1558 - ], 1559 - "2": [ 1560 - 0, 1561 - ], 1562 - "3": [ 1563 - 1, 1564 - ], 1565 - "4": [ 1566 - 0, 1567 - ], 1568 - "5": [ 1569 - 0, 1570 - ], 1571 - }, 1572 - "branchMap": { 1573 - "0": { 1574 - "line": 5, 1575 - "loc": { 1576 - "end": { 1577 - "column": 1, 1578 - "line": 27, 1579 - }, 1580 - "start": { 1581 - "column": 0, 1582 - "line": 5, 1583 - }, 1584 - }, 1585 - "locations": [ 1586 - { 1587 - "end": { 1588 - "column": 1, 1589 - "line": 27, 1590 - }, 1591 - "start": { 1592 - "column": 0, 1593 - "line": 5, 1594 - }, 1595 - }, 1596 - ], 1597 - "type": "branch", 1598 - }, 1599 - "1": { 1600 - "line": 8, 1601 - "loc": { 1602 - "end": { 1603 - "column": 3, 1604 - "line": 10, 1605 - }, 1606 - "start": { 1607 - "column": 28, 1608 - "line": 8, 1609 - }, 1610 - }, 1611 - "locations": [ 1612 - { 1613 - "end": { 1614 - "column": 3, 1615 - "line": 10, 1616 - }, 1617 - "start": { 1618 - "column": 28, 1619 - "line": 8, 1620 - }, 1621 - }, 1622 - ], 1623 - "type": "branch", 1624 - }, 1625 - "2": { 1626 - "line": 22, 1627 - "loc": { 1628 - "end": { 1629 - "column": 3, 1630 - "line": 24, 1631 - }, 1632 - "start": { 1633 - "column": 32, 1634 - "line": 22, 1635 - }, 1636 - }, 1637 - "locations": [ 1638 - { 1639 - "end": { 1640 - "column": 3, 1641 - "line": 24, 1642 - }, 1643 - "start": { 1644 - "column": 32, 1645 - "line": 22, 1646 - }, 1647 - }, 1648 - ], 1649 - "type": "branch", 1650 - }, 1651 - "3": { 1652 - "line": 29, 1653 - "loc": { 1654 - "end": { 1655 - "column": 1, 1656 - "line": 51, 1657 - }, 1658 - "start": { 1659 - "column": 0, 1660 - "line": 29, 1661 - }, 1662 - }, 1663 - "locations": [ 1664 - { 1665 - "end": { 1666 - "column": 1, 1667 - "line": 51, 1668 - }, 1669 - "start": { 1670 - "column": 0, 1671 - "line": 29, 1672 - }, 1673 - }, 1674 - ], 1675 - "type": "branch", 1676 - }, 1677 - "4": { 1678 - "line": 32, 1679 - "loc": { 1680 - "end": { 1681 - "column": 3, 1682 - "line": 34, 1683 - }, 1684 - "start": { 1685 - "column": 28, 1686 - "line": 32, 1687 - }, 1688 - }, 1689 - "locations": [ 1690 - { 1691 - "end": { 1692 - "column": 3, 1693 - "line": 34, 1694 - }, 1695 - "start": { 1696 - "column": 28, 1697 - "line": 32, 1698 - }, 1699 - }, 1700 - ], 1701 - "type": "branch", 1702 - }, 1703 - "5": { 1704 - "line": 46, 1705 - "loc": { 1706 - "end": { 1707 - "column": 3, 1708 - "line": 48, 1709 - }, 1710 - "start": { 1711 - "column": 32, 1712 - "line": 46, 1713 - }, 1714 - }, 1715 - "locations": [ 1716 - { 1717 - "end": { 1718 - "column": 3, 1719 - "line": 48, 1720 - }, 1721 - "start": { 1722 - "column": 32, 1723 - "line": 46, 1724 - }, 1725 - }, 1726 - ], 1727 - "type": "branch", 1728 - }, 1729 - }, 1730 - "f": { 1731 - "0": 1, 1732 - "1": 1, 1733 - }, 1734 - "fnMap": { 1735 - "0": { 1736 - "decl": { 1737 - "end": { 1738 - "column": 1, 1739 - "line": 27, 1740 - }, 1741 - "start": { 1742 - "column": 0, 1743 - "line": 5, 1744 - }, 1745 - }, 1746 - "line": 5, 1747 - "loc": { 1748 - "end": { 1749 - "column": 1, 1750 - "line": 27, 1751 - }, 1752 - "start": { 1753 - "column": 0, 1754 - "line": 5, 1755 - }, 1756 - }, 1757 - "name": "runDynamicFileESM", 1758 - }, 1759 - "1": { 1760 - "decl": { 1761 - "end": { 1762 - "column": 1, 1763 - "line": 51, 1764 - }, 1765 - "start": { 1766 - "column": 0, 1767 - "line": 29, 1768 - }, 1769 - }, 1770 - "line": 29, 1771 - "loc": { 1772 - "end": { 1773 - "column": 1, 1774 - "line": 51, 1775 - }, 1776 - "start": { 1777 - "column": 0, 1778 - "line": 29, 1779 - }, 1780 - }, 1781 - "name": "runDynamicFileCJS", 1782 - }, 1783 - }, 1784 - "path": "<process-cwd>/src/dynamic-files.ts", 1785 - "s": { 1786 - "0": 1, 1787 - "1": 1, 1788 - "11": 1, 1789 - "17": 1, 1790 - "19": 1, 1791 - "2": 1, 1792 - "21": 1, 1793 - "22": 0, 1794 - "23": 0, 1795 - "25": 1, 1796 - "26": 1, 1797 - "28": 1, 1798 - "29": 1, 1799 - "31": 1, 1800 - "32": 0, 1801 - "33": 0, 1802 - "35": 1, 1803 - "4": 1, 1804 - "41": 1, 1805 - "43": 1, 1806 - "45": 1, 1807 - "46": 0, 1808 - "47": 0, 1809 - "49": 1, 1810 - "5": 1, 1811 - "50": 1, 1812 - "7": 1, 1813 - "8": 0, 1814 - "9": 0, 1815 - }, 1816 - "statementMap": { 1817 - "0": { 1818 - "end": { 1819 - "column": 59, 1820 - "line": 1, 1821 - }, 1822 - "start": { 1823 - "column": 0, 1824 - "line": 1, 1825 - }, 1826 - }, 1827 - "1": { 1828 - "end": { 1829 - "column": 43, 1830 - "line": 2, 1831 - }, 1832 - "start": { 1833 - "column": 0, 1834 - "line": 2, 1835 - }, 1836 - }, 1837 - "11": { 1838 - "end": { 1839 - "column": 27, 1840 - "line": 12, 1841 - }, 1842 - "start": { 1843 - "column": 0, 1844 - "line": 12, 1845 - }, 1846 - }, 1847 - "17": { 1848 - "end": { 1849 - "column": 20, 1850 - "line": 18, 1851 - }, 1852 - "start": { 1853 - "column": 0, 1854 - "line": 18, 1855 - }, 1856 - }, 1857 - "19": { 1858 - "end": { 1859 - "column": 40, 1860 - "line": 20, 1861 - }, 1862 - "start": { 1863 - "column": 0, 1864 - "line": 20, 1865 - }, 1866 - }, 1867 - "2": { 1868 - "end": { 1869 - "column": 40, 1870 - "line": 3, 1871 - }, 1872 - "start": { 1873 - "column": 0, 1874 - "line": 3, 1875 - }, 1876 - }, 1877 - "21": { 1878 - "end": { 1879 - "column": 33, 1880 - "line": 22, 1881 - }, 1882 - "start": { 1883 - "column": 0, 1884 - "line": 22, 1885 - }, 1886 - }, 1887 - "22": { 1888 - "end": { 1889 - "column": 48, 1890 - "line": 23, 1891 - }, 1892 - "start": { 1893 - "column": 0, 1894 - "line": 23, 1895 - }, 1896 - }, 1897 - "23": { 1898 - "end": { 1899 - "column": 3, 1900 - "line": 24, 1901 - }, 1902 - "start": { 1903 - "column": 0, 1904 - "line": 24, 1905 - }, 1906 - }, 1907 - "25": { 1908 - "end": { 1909 - "column": 18, 1910 - "line": 26, 1911 - }, 1912 - "start": { 1913 - "column": 0, 1914 - "line": 26, 1915 - }, 1916 - }, 1917 - "26": { 1918 - "end": { 1919 - "column": 1, 1920 - "line": 27, 1921 - }, 1922 - "start": { 1923 - "column": 0, 1924 - "line": 27, 1925 - }, 1926 - }, 1927 - "28": { 1928 - "end": { 1929 - "column": 43, 1930 - "line": 29, 1931 - }, 1932 - "start": { 1933 - "column": 0, 1934 - "line": 29, 1935 - }, 1936 - }, 1937 - "29": { 1938 - "end": { 1939 - "column": 91, 1940 - "line": 30, 1941 - }, 1942 - "start": { 1943 - "column": 0, 1944 - "line": 30, 1945 - }, 1946 - }, 1947 - "31": { 1948 - "end": { 1949 - "column": 29, 1950 - "line": 32, 1951 - }, 1952 - "start": { 1953 - "column": 0, 1954 - "line": 32, 1955 - }, 1956 - }, 1957 - "32": { 1958 - "end": { 1959 - "column": 20, 1960 - "line": 33, 1961 - }, 1962 - "start": { 1963 - "column": 0, 1964 - "line": 33, 1965 - }, 1966 - }, 1967 - "33": { 1968 - "end": { 1969 - "column": 3, 1970 - "line": 34, 1971 - }, 1972 - "start": { 1973 - "column": 0, 1974 - "line": 34, 1975 - }, 1976 - }, 1977 - "35": { 1978 - "end": { 1979 - "column": 27, 1980 - "line": 36, 1981 - }, 1982 - "start": { 1983 - "column": 0, 1984 - "line": 36, 1985 - }, 1986 - }, 1987 - "4": { 1988 - "end": { 1989 - "column": 43, 1990 - "line": 5, 1991 - }, 1992 - "start": { 1993 - "column": 0, 1994 - "line": 5, 1995 - }, 1996 - }, 1997 - "41": { 1998 - "end": { 1999 - "column": 20, 2000 - "line": 42, 2001 - }, 2002 - "start": { 2003 - "column": 0, 2004 - "line": 42, 2005 - }, 2006 - }, 2007 - "43": { 2008 - "end": { 2009 - "column": 58, 2010 - "line": 44, 2011 - }, 2012 - "start": { 2013 - "column": 0, 2014 - "line": 44, 2015 - }, 2016 - }, 2017 - "45": { 2018 - "end": { 2019 - "column": 33, 2020 - "line": 46, 2021 - }, 2022 - "start": { 2023 - "column": 0, 2024 - "line": 46, 2025 - }, 2026 - }, 2027 - "46": { 2028 - "end": { 2029 - "column": 48, 2030 - "line": 47, 2031 - }, 2032 - "start": { 2033 - "column": 0, 2034 - "line": 47, 2035 - }, 2036 - }, 2037 - "47": { 2038 - "end": { 2039 - "column": 3, 2040 - "line": 48, 2041 - }, 2042 - "start": { 2043 - "column": 0, 2044 - "line": 48, 2045 - }, 2046 - }, 2047 - "49": { 2048 - "end": { 2049 - "column": 18, 2050 - "line": 50, 2051 - }, 2052 - "start": { 2053 - "column": 0, 2054 - "line": 50, 2055 - }, 2056 - }, 2057 - "5": { 2058 - "end": { 2059 - "column": 90, 2060 - "line": 6, 2061 - }, 2062 - "start": { 2063 - "column": 0, 2064 - "line": 6, 2065 - }, 2066 - }, 2067 - "50": { 2068 - "end": { 2069 - "column": 1, 2070 - "line": 51, 2071 - }, 2072 - "start": { 2073 - "column": 0, 2074 - "line": 51, 2075 - }, 2076 - }, 2077 - "7": { 2078 - "end": { 2079 - "column": 29, 2080 - "line": 8, 2081 - }, 2082 - "start": { 2083 - "column": 0, 2084 - "line": 8, 2085 - }, 2086 - }, 2087 - "8": { 2088 - "end": { 2089 - "column": 20, 2090 - "line": 9, 2091 - }, 2092 - "start": { 2093 - "column": 0, 2094 - "line": 9, 2095 - }, 2096 - }, 2097 - "9": { 2098 - "end": { 2099 - "column": 3, 2100 - "line": 10, 2101 - }, 2102 - "start": { 2103 - "column": 0, 2104 - "line": 10, 2105 - }, 2106 - }, 2107 - }, 2108 - }, 2109 - "<process-cwd>/src/empty-lines.ts": { 2110 - "all": true, 2111 - "b": { 2112 - "0": [ 2113 - 1, 2114 - ], 2115 - }, 2116 - "branchMap": { 2117 - "0": { 2118 - "line": 1, 2119 - "loc": { 2120 - "end": { 2121 - "column": 1, 2122 - "line": 29, 2123 - }, 2124 - "start": { 2125 - "column": 478, 2126 - "line": 1, 2127 - }, 2128 - }, 2129 - "locations": [ 2130 - { 2131 - "end": { 2132 - "column": 1, 2133 - "line": 29, 2134 - }, 2135 - "start": { 2136 - "column": 478, 2137 - "line": 1, 2138 - }, 2139 - }, 2140 - ], 2141 - "type": "branch", 2142 - }, 2143 - }, 2144 - "f": { 2145 - "0": 1, 2146 - }, 2147 - "fnMap": { 2148 - "0": { 2149 - "decl": { 2150 - "end": { 2151 - "column": 1, 2152 - "line": 29, 2153 - }, 2154 - "start": { 2155 - "column": 478, 2156 - "line": 1, 2157 - }, 2158 - }, 2159 - "line": 1, 2160 - "loc": { 2161 - "end": { 2162 - "column": 1, 2163 - "line": 29, 2164 - }, 2165 - "start": { 2166 - "column": 478, 2167 - "line": 1, 2168 - }, 2169 - }, 2170 - "name": "(empty-report)", 2171 - }, 2172 - }, 2173 - "path": "<process-cwd>/src/empty-lines.ts", 2174 - "s": { 2175 - "1": 0, 2176 - "10": 0, 2177 - "14": 0, 2178 - "16": 0, 2179 - "17": 0, 2180 - "27": 0, 2181 - "28": 0, 2182 - "7": 0, 2183 - "9": 0, 2184 - }, 2185 - "statementMap": { 2186 - "1": { 2187 - "end": { 2188 - "column": 43, 2189 - "line": 2, 2190 - }, 2191 - "start": { 2192 - "column": 0, 2193 - "line": 2, 2194 - }, 2195 - }, 2196 - "10": { 2197 - "end": { 2198 - "column": 3, 2199 - "line": 11, 2200 - }, 2201 - "start": { 2202 - "column": 0, 2203 - "line": 11, 2204 - }, 2205 - }, 2206 - "14": { 2207 - "end": { 2208 - "column": 27, 2209 - "line": 15, 2210 - }, 2211 - "start": { 2212 - "column": 0, 2213 - "line": 15, 2214 - }, 2215 - }, 2216 - "16": { 2217 - "end": { 2218 - "column": 12, 2219 - "line": 17, 2220 - }, 2221 - "start": { 2222 - "column": 0, 2223 - "line": 17, 2224 - }, 2225 - }, 2226 - "17": { 2227 - "end": { 2228 - "column": 3, 2229 - "line": 18, 2230 - }, 2231 - "start": { 2232 - "column": 0, 2233 - "line": 18, 2234 - }, 2235 - }, 2236 - "27": { 2237 - "end": { 2238 - "column": 14, 2239 - "line": 28, 2240 - }, 2241 - "start": { 2242 - "column": 0, 2243 - "line": 28, 2244 - }, 2245 - }, 2246 - "28": { 2247 - "end": { 2248 - "column": 1, 2249 - "line": 29, 2250 - }, 2251 - "start": { 2252 - "column": 0, 2253 - "line": 29, 2254 - }, 2255 - }, 2256 - "7": { 2257 - "end": { 2258 - "column": 27, 2259 - "line": 8, 2260 - }, 2261 - "start": { 2262 - "column": 0, 2263 - "line": 8, 2264 - }, 2265 - }, 2266 - "9": { 2267 - "end": { 2268 - "column": 12, 2269 - "line": 10, 2270 - }, 2271 - "start": { 2272 - "column": 0, 2273 - "line": 10, 2274 - }, 2275 - }, 2276 - }, 2277 - }, 2278 - "<process-cwd>/src/file-to-change.ts": { 2279 - "all": true, 2280 - "b": { 2281 - "0": [ 2282 - 0, 2283 - ], 2284 - }, 2285 - "branchMap": { 2286 - "0": { 2287 - "line": 1, 2288 - "loc": { 2289 - "end": { 2290 - "column": 1, 2291 - "line": 7, 2292 - }, 2293 - "start": { 2294 - "column": 133, 2295 - "line": 1, 2296 - }, 2297 - }, 2298 - "locations": [ 2299 - { 2300 - "end": { 2301 - "column": 1, 2302 - "line": 7, 2303 - }, 2304 - "start": { 2305 - "column": 133, 2306 - "line": 1, 2307 - }, 2308 - }, 2309 - ], 2310 - "type": "branch", 2311 - }, 2312 - }, 2313 - "f": { 2314 - "0": 0, 2315 - }, 2316 - "fnMap": { 2317 - "0": { 2318 - "decl": { 2319 - "end": { 2320 - "column": 1, 2321 - "line": 7, 2322 - }, 2323 - "start": { 2324 - "column": 133, 2325 - "line": 1, 2326 - }, 2327 - }, 2328 - "line": 1, 2329 - "loc": { 2330 - "end": { 2331 - "column": 1, 2332 - "line": 7, 2333 - }, 2334 - "start": { 2335 - "column": 133, 2336 - "line": 1, 2337 - }, 2338 - }, 2339 - "name": "(empty-report)", 2340 - }, 2341 - }, 2342 - "path": "<process-cwd>/src/file-to-change.ts", 2343 - "s": { 2344 - "0": 0, 2345 - "1": 0, 2346 - "2": 0, 2347 - "4": 0, 2348 - "5": 0, 2349 - "6": 0, 2350 - }, 2351 - "statementMap": { 2352 - "0": { 2353 - "end": { 2354 - "column": 23, 2355 - "line": 1, 2356 - }, 2357 - "start": { 2358 - "column": 0, 2359 - "line": 1, 2360 - }, 2361 - }, 2362 - "1": { 2363 - "end": { 2364 - "column": 51, 2365 - "line": 2, 2366 - }, 2367 - "start": { 2368 - "column": 0, 2369 - "line": 2, 2370 - }, 2371 - }, 2372 - "2": { 2373 - "end": { 2374 - "column": 1, 2375 - "line": 3, 2376 - }, 2377 - "start": { 2378 - "column": 0, 2379 - "line": 3, 2380 - }, 2381 - }, 2382 - "4": { 2383 - "end": { 2384 - "column": 37, 2385 - "line": 5, 2386 - }, 2387 - "start": { 2388 - "column": 0, 2389 - "line": 5, 2390 - }, 2391 - }, 2392 - "5": { 2393 - "end": { 2394 - "column": 14, 2395 - "line": 6, 2396 - }, 2397 - "start": { 2398 - "column": 0, 2399 - "line": 6, 2400 - }, 2401 - }, 2402 - "6": { 2403 - "end": { 2404 - "column": 1, 2405 - "line": 7, 2406 - }, 2407 - "start": { 2408 - "column": 0, 2409 - "line": 7, 2410 - }, 2411 - }, 2412 - }, 2413 - }, 2414 - "<process-cwd>/src/function-count.ts": { 2415 - "all": false, 2416 - "b": { 2417 - "0": [ 2418 - 1, 2419 - ], 2420 - "1": [ 2421 - 1, 2422 - ], 2423 - "2": [ 2424 - 1, 2425 - ], 2426 - }, 2427 - "branchMap": { 2428 - "0": { 2429 - "line": 11, 2430 - "loc": { 2431 - "end": { 2432 - "column": 1, 2433 - "line": 13, 2434 - }, 2435 - "start": { 2436 - "column": 0, 2437 - "line": 11, 2438 - }, 2439 - }, 2440 - "locations": [ 2441 - { 2442 - "end": { 2443 - "column": 1, 2444 - "line": 13, 2445 - }, 2446 - "start": { 2447 - "column": 0, 2448 - "line": 11, 2449 - }, 2450 - }, 2451 - ], 2452 - "type": "branch", 2453 - }, 2454 - "1": { 2455 - "line": 18, 2456 - "loc": { 2457 - "end": { 2458 - "column": 1, 2459 - "line": 21, 2460 - }, 2461 - "start": { 2462 - "column": 7, 2463 - "line": 18, 2464 - }, 2465 - }, 2466 - "locations": [ 2467 - { 2468 - "end": { 2469 - "column": 1, 2470 - "line": 21, 2471 - }, 2472 - "start": { 2473 - "column": 7, 2474 - "line": 18, 2475 - }, 2476 - }, 2477 - ], 2478 - "type": "branch", 2479 - }, 2480 - "2": { 2481 - "line": 34, 2482 - "loc": { 2483 - "end": { 2484 - "column": 1, 2485 - "line": 36, 2486 - }, 2487 - "start": { 2488 - "column": 0, 2489 - "line": 34, 2490 - }, 2491 - }, 2492 - "locations": [ 2493 - { 2494 - "end": { 2495 - "column": 1, 2496 - "line": 36, 2497 - }, 2498 - "start": { 2499 - "column": 0, 2500 - "line": 34, 2501 - }, 2502 - }, 2503 - ], 2504 - "type": "branch", 2505 - }, 2506 - }, 2507 - "f": { 2508 - "0": 1, 2509 - "1": 1, 2510 - "2": 0, 2511 - "3": 0, 2512 - "4": 1, 2513 - }, 2514 - "fnMap": { 2515 - "0": { 2516 - "decl": { 2517 - "end": { 2518 - "column": 1, 2519 - "line": 13, 2520 - }, 2521 - "start": { 2522 - "column": 0, 2523 - "line": 11, 2524 - }, 2525 - }, 2526 - "line": 11, 2527 - "loc": { 2528 - "end": { 2529 - "column": 1, 2530 - "line": 13, 2531 - }, 2532 - "start": { 2533 - "column": 0, 2534 - "line": 11, 2535 - }, 2536 - }, 2537 - "name": "first", 2538 - }, 2539 - "1": { 2540 - "decl": { 2541 - "end": { 2542 - "column": 1, 2543 - "line": 21, 2544 - }, 2545 - "start": { 2546 - "column": 7, 2547 - "line": 18, 2548 - }, 2549 - }, 2550 - "line": 18, 2551 - "loc": { 2552 - "end": { 2553 - "column": 1, 2554 - "line": 21, 2555 - }, 2556 - "start": { 2557 - "column": 7, 2558 - "line": 18, 2559 - }, 2560 - }, 2561 - "name": "second", 2562 - }, 2563 - "2": { 2564 - "decl": { 2565 - "end": { 2566 - "column": 1, 2567 - "line": 26, 2568 - }, 2569 - "start": { 2570 - "column": 7, 2571 - "line": 24, 2572 - }, 2573 - }, 2574 - "line": 24, 2575 - "loc": { 2576 - "end": { 2577 - "column": 1, 2578 - "line": 26, 2579 - }, 2580 - "start": { 2581 - "column": 7, 2582 - "line": 24, 2583 - }, 2584 - }, 2585 - "name": "third", 2586 - }, 2587 - "3": { 2588 - "decl": { 2589 - "end": { 2590 - "column": 1, 2591 - "line": 31, 2592 - }, 2593 - "start": { 2594 - "column": 0, 2595 - "line": 29, 2596 - }, 2597 - }, 2598 - "line": 29, 2599 - "loc": { 2600 - "end": { 2601 - "column": 1, 2602 - "line": 31, 2603 - }, 2604 - "start": { 2605 - "column": 0, 2606 - "line": 29, 2607 - }, 2608 - }, 2609 - "name": "fourth", 2610 - }, 2611 - "4": { 2612 - "decl": { 2613 - "end": { 2614 - "column": 1, 2615 - "line": 36, 2616 - }, 2617 - "start": { 2618 - "column": 0, 2619 - "line": 34, 2620 - }, 2621 - }, 2622 - "line": 34, 2623 - "loc": { 2624 - "end": { 2625 - "column": 1, 2626 - "line": 36, 2627 - }, 2628 - "start": { 2629 - "column": 0, 2630 - "line": 34, 2631 - }, 2632 - }, 2633 - "name": "fifth", 2634 - }, 2635 - }, 2636 - "path": "<process-cwd>/src/function-count.ts", 2637 - "s": { 2638 - "10": 1, 2639 - "11": 1, 2640 - "12": 1, 2641 - "14": 1, 2642 - "17": 1, 2643 - "18": 1, 2644 - "19": 1, 2645 - "20": 1, 2646 - "23": 1, 2647 - "24": 0, 2648 - "25": 0, 2649 - "28": 0, 2650 - "29": 0, 2651 - "30": 0, 2652 - "33": 1, 2653 - "34": 1, 2654 - "35": 1, 2655 - }, 2656 - "statementMap": { 2657 - "10": { 2658 - "end": { 2659 - "column": 18, 2660 - "line": 11, 2661 - }, 2662 - "start": { 2663 - "column": 0, 2664 - "line": 11, 2665 - }, 2666 - }, 2667 - "11": { 2668 - "end": { 2669 - "column": 10, 2670 - "line": 12, 2671 - }, 2672 - "start": { 2673 - "column": 0, 2674 - "line": 12, 2675 - }, 2676 - }, 2677 - "12": { 2678 - "end": { 2679 - "column": 1, 2680 - "line": 13, 2681 - }, 2682 - "start": { 2683 - "column": 0, 2684 - "line": 13, 2685 - }, 2686 - }, 2687 - "14": { 2688 - "end": { 2689 - "column": 7, 2690 - "line": 15, 2691 - }, 2692 - "start": { 2693 - "column": 0, 2694 - "line": 15, 2695 - }, 2696 - }, 2697 - "17": { 2698 - "end": { 2699 - "column": 26, 2700 - "line": 18, 2701 - }, 2702 - "start": { 2703 - "column": 0, 2704 - "line": 18, 2705 - }, 2706 - }, 2707 - "18": { 2708 - "end": { 2709 - "column": 9, 2710 - "line": 19, 2711 - }, 2712 - "start": { 2713 - "column": 0, 2714 - "line": 19, 2715 - }, 2716 - }, 2717 - "19": { 2718 - "end": { 2719 - "column": 10, 2720 - "line": 20, 2721 - }, 2722 - "start": { 2723 - "column": 0, 2724 - "line": 20, 2725 - }, 2726 - }, 2727 - "20": { 2728 - "end": { 2729 - "column": 1, 2730 - "line": 21, 2731 - }, 2732 - "start": { 2733 - "column": 0, 2734 - "line": 21, 2735 - }, 2736 - }, 2737 - "23": { 2738 - "end": { 2739 - "column": 25, 2740 - "line": 24, 2741 - }, 2742 - "start": { 2743 - "column": 0, 2744 - "line": 24, 2745 - }, 2746 - }, 2747 - "24": { 2748 - "end": { 2749 - "column": 46, 2750 - "line": 25, 2751 - }, 2752 - "start": { 2753 - "column": 0, 2754 - "line": 25, 2755 - }, 2756 - }, 2757 - "25": { 2758 - "end": { 2759 - "column": 1, 2760 - "line": 26, 2761 - }, 2762 - "start": { 2763 - "column": 0, 2764 - "line": 26, 2765 - }, 2766 - }, 2767 - "28": { 2768 - "end": { 2769 - "column": 19, 2770 - "line": 29, 2771 - }, 2772 - "start": { 2773 - "column": 0, 2774 - "line": 29, 2775 - }, 2776 - }, 2777 - "29": { 2778 - "end": { 2779 - "column": 10, 2780 - "line": 30, 2781 - }, 2782 - "start": { 2783 - "column": 0, 2784 - "line": 30, 2785 - }, 2786 - }, 2787 - "30": { 2788 - "end": { 2789 - "column": 1, 2790 - "line": 31, 2791 - }, 2792 - "start": { 2793 - "column": 0, 2794 - "line": 31, 2795 - }, 2796 - }, 2797 - "33": { 2798 - "end": { 2799 - "column": 18, 2800 - "line": 34, 2801 - }, 2802 - "start": { 2803 - "column": 0, 2804 - "line": 34, 2805 - }, 2806 - }, 2807 - "34": { 2808 - "end": { 2809 - "column": 10, 2810 - "line": 35, 2811 - }, 2812 - "start": { 2813 - "column": 0, 2814 - "line": 35, 2815 - }, 2816 - }, 2817 - "35": { 2818 - "end": { 2819 - "column": 1, 2820 - "line": 36, 2821 - }, 2822 - "start": { 2823 - "column": 0, 2824 - "line": 36, 2825 - }, 2826 - }, 2827 - }, 2828 - }, 2829 - "<process-cwd>/src/implicitElse.ts": { 2830 - "all": false, 2831 - "b": { 2832 - "0": [ 2833 - 1, 2834 - ], 2835 - }, 2836 - "branchMap": { 2837 - "0": { 2838 - "line": 1, 2839 - "loc": { 2840 - "end": { 2841 - "column": 1, 2842 - "line": 9, 2843 - }, 2844 - "start": { 2845 - "column": 7, 2846 - "line": 1, 2847 - }, 2848 - }, 2849 - "locations": [ 2850 - { 2851 - "end": { 2852 - "column": 1, 2853 - "line": 9, 2854 - }, 2855 - "start": { 2856 - "column": 7, 2857 - "line": 1, 2858 - }, 2859 - }, 2860 - ], 2861 - "type": "branch", 2862 - }, 2863 - }, 2864 - "f": { 2865 - "0": 1, 2866 - }, 2867 - "fnMap": { 2868 - "0": { 2869 - "decl": { 2870 - "end": { 2871 - "column": 1, 2872 - "line": 9, 2873 - }, 2874 - "start": { 2875 - "column": 7, 2876 - "line": 1, 2877 - }, 2878 - }, 2879 - "line": 1, 2880 - "loc": { 2881 - "end": { 2882 - "column": 1, 2883 - "line": 9, 2884 - }, 2885 - "start": { 2886 - "column": 7, 2887 - "line": 1, 2888 - }, 2889 - }, 2890 - "name": "implicitElse", 2891 - }, 2892 - }, 2893 - "path": "<process-cwd>/src/implicitElse.ts", 2894 - "s": { 2895 - "0": 1, 2896 - "1": 1, 2897 - "3": 1, 2898 - "4": 1, 2899 - "5": 1, 2900 - "7": 1, 2901 - "8": 1, 2902 - }, 2903 - "statementMap": { 2904 - "0": { 2905 - "end": { 2906 - "column": 50, 2907 - "line": 1, 2908 - }, 2909 - "start": { 2910 - "column": 0, 2911 - "line": 1, 2912 - }, 2913 - }, 2914 - "1": { 2915 - "end": { 2916 - "column": 11, 2917 - "line": 2, 2918 - }, 2919 - "start": { 2920 - "column": 0, 2921 - "line": 2, 2922 - }, 2923 - }, 2924 - "3": { 2925 - "end": { 2926 - "column": 18, 2927 - "line": 4, 2928 - }, 2929 - "start": { 2930 - "column": 0, 2931 - "line": 4, 2932 - }, 2933 - }, 2934 - "4": { 2935 - "end": { 2936 - "column": 9, 2937 - "line": 5, 2938 - }, 2939 - "start": { 2940 - "column": 0, 2941 - "line": 5, 2942 - }, 2943 - }, 2944 - "5": { 2945 - "end": { 2946 - "column": 3, 2947 - "line": 6, 2948 - }, 2949 - "start": { 2950 - "column": 0, 2951 - "line": 6, 2952 - }, 2953 - }, 2954 - "7": { 2955 - "end": { 2956 - "column": 10, 2957 - "line": 8, 2958 - }, 2959 - "start": { 2960 - "column": 0, 2961 - "line": 8, 2962 - }, 2963 - }, 2964 - "8": { 2965 - "end": { 2966 - "column": 1, 2967 - "line": 9, 2968 - }, 2969 - "start": { 2970 - "column": 0, 2971 - "line": 9, 2972 - }, 2973 - }, 2974 - }, 2975 - }, 2976 - "<process-cwd>/src/importEnv.ts": { 2977 - "all": false, 2978 - "b": { 2979 - "0": [ 2980 - 1, 2981 - ], 2982 - }, 2983 - "branchMap": { 2984 - "0": { 2985 - "line": 1, 2986 - "loc": { 2987 - "end": { 2988 - "column": 1, 2989 - "line": 3, 2990 - }, 2991 - "start": { 2992 - "column": 7, 2993 - "line": 1, 2994 - }, 2995 - }, 2996 - "locations": [ 2997 - { 2998 - "end": { 2999 - "column": 1, 3000 - "line": 3, 3001 - }, 3002 - "start": { 3003 - "column": 7, 3004 - "line": 1, 3005 - }, 3006 - }, 3007 - ], 3008 - "type": "branch", 3009 - }, 3010 - }, 3011 - "f": { 3012 - "0": 1, 3013 - }, 3014 - "fnMap": { 3015 - "0": { 3016 - "decl": { 3017 - "end": { 3018 - "column": 1, 3019 - "line": 3, 3020 - }, 3021 - "start": { 3022 - "column": 7, 3023 - "line": 1, 3024 - }, 3025 - }, 3026 - "line": 1, 3027 - "loc": { 3028 - "end": { 3029 - "column": 1, 3030 - "line": 3, 3031 - }, 3032 - "start": { 3033 - "column": 7, 3034 - "line": 1, 3035 - }, 3036 - }, 3037 - "name": "useImportEnv", 3038 - }, 3039 - }, 3040 - "path": "<process-cwd>/src/importEnv.ts", 3041 - "s": { 3042 - "0": 1, 3043 - "1": 1, 3044 - "2": 1, 3045 - }, 3046 - "statementMap": { 3047 - "0": { 3048 - "end": { 3049 - "column": 32, 3050 - "line": 1, 3051 - }, 3052 - "start": { 3053 - "column": 0, 3054 - "line": 1, 3055 - }, 3056 - }, 3057 - "1": { 3058 - "end": { 3059 - "column": 46, 3060 - "line": 2, 3061 - }, 3062 - "start": { 3063 - "column": 0, 3064 - "line": 2, 3065 - }, 3066 - }, 3067 - "2": { 3068 - "end": { 3069 - "column": 1, 3070 - "line": 3, 3071 - }, 3072 - "start": { 3073 - "column": 0, 3074 - "line": 3, 3075 - }, 3076 - }, 3077 - }, 3078 - }, 3079 - "<process-cwd>/src/index.mts": { 3080 - "all": false, 3081 - "b": { 3082 - "0": [ 3083 - 1, 3084 - ], 3085 - }, 3086 - "branchMap": { 3087 - "0": { 3088 - "line": 5, 3089 - "loc": { 3090 - "end": { 3091 - "column": 1, 3092 - "line": 7, 3093 - }, 3094 - "start": { 3095 - "column": 7, 3096 - "line": 5, 3097 - }, 3098 - }, 3099 - "locations": [ 3100 - { 3101 - "end": { 3102 - "column": 1, 3103 - "line": 7, 3104 - }, 3105 - "start": { 3106 - "column": 7, 3107 - "line": 5, 3108 - }, 3109 - }, 3110 - ], 3111 - "type": "branch", 3112 - }, 3113 - }, 3114 - "f": { 3115 - "0": 1, 3116 - }, 3117 - "fnMap": { 3118 - "0": { 3119 - "decl": { 3120 - "end": { 3121 - "column": 1, 3122 - "line": 7, 3123 - }, 3124 - "start": { 3125 - "column": 7, 3126 - "line": 5, 3127 - }, 3128 - }, 3129 - "line": 5, 3130 - "loc": { 3131 - "end": { 3132 - "column": 1, 3133 - "line": 7, 3134 - }, 3135 - "start": { 3136 - "column": 7, 3137 - "line": 5, 3138 - }, 3139 - }, 3140 - "name": "pythagoras", 3141 - }, 3142 - }, 3143 - "path": "<process-cwd>/src/index.mts", 3144 - "s": { 3145 - "0": 1, 3146 - "2": 1, 3147 - "4": 1, 3148 - "5": 1, 3149 - "6": 1, 3150 - }, 3151 - "statementMap": { 3152 - "0": { 3153 - "end": { 3154 - "column": 45, 3155 - "line": 1, 3156 - }, 3157 - "start": { 3158 - "column": 0, 3159 - "line": 1, 3160 - }, 3161 - }, 3162 - "2": { 3163 - "end": { 3164 - "column": 23, 3165 - "line": 3, 3166 - }, 3167 - "start": { 3168 - "column": 0, 3169 - "line": 3, 3170 - }, 3171 - }, 3172 - "4": { 3173 - "end": { 3174 - "column": 50, 3175 - "line": 5, 3176 - }, 3177 - "start": { 3178 - "column": 0, 3179 - "line": 5, 3180 - }, 3181 - }, 3182 - "5": { 3183 - "end": { 3184 - "column": 50, 3185 - "line": 6, 3186 - }, 3187 - "start": { 3188 - "column": 0, 3189 - "line": 6, 3190 - }, 3191 - }, 3192 - "6": { 3193 - "end": { 3194 - "column": 1, 3195 - "line": 7, 3196 - }, 3197 - "start": { 3198 - "column": 0, 3199 - "line": 7, 3200 - }, 3201 - }, 3202 - }, 3203 - }, 3204 - "<process-cwd>/src/load-outside-vite.cjs": { 3205 - "all": false, 3206 - "b": {}, 3207 - "branchMap": {}, 3208 - "f": { 3209 - "0": 0, 3210 - }, 3211 - "fnMap": { 3212 - "0": { 3213 - "decl": { 3214 - "end": { 3215 - "column": 35, 3216 - "line": 1, 3217 - }, 3218 - "start": { 3219 - "column": 17, 3220 - "line": 1, 3221 - }, 3222 - }, 3223 - "line": 1, 3224 - "loc": { 3225 - "end": { 3226 - "column": 35, 3227 - "line": 1, 3228 - }, 3229 - "start": { 3230 - "column": 17, 3231 - "line": 1, 3232 - }, 3233 - }, 3234 - "name": "noop", 3235 - }, 3236 - }, 3237 - "path": "<process-cwd>/src/load-outside-vite.cjs", 3238 - "s": { 3239 - "0": 1, 3240 - }, 3241 - "statementMap": { 3242 - "0": { 3243 - "end": { 3244 - "column": 35, 3245 - "line": 1, 3246 - }, 3247 - "start": { 3248 - "column": 0, 3249 - "line": 1, 3250 - }, 3251 - }, 3252 - }, 3253 - }, 3254 - "<process-cwd>/src/multi-environment.ts": { 3255 - "all": false, 3256 - "b": { 3257 - "0": [ 3258 - 4, 3259 - ], 3260 - "1": [ 3261 - 0, 3262 - ], 3263 - "10": [ 3264 - 1, 3265 - ], 3266 - "2": [ 3267 - 0, 3268 - ], 3269 - "3": [ 3270 - 1, 3271 - ], 3272 - "4": [ 3273 - 1, 3274 - ], 3275 - "5": [ 3276 - 0, 3277 - ], 3278 - "6": [ 3279 - 0, 3280 - ], 3281 - "7": [ 3282 - 1, 3283 - ], 3284 - "8": [ 3285 - 2, 3286 - ], 3287 - "9": [ 3288 - 3, 3289 - ], 3290 - }, 3291 - "branchMap": { 3292 - "0": { 3293 - "line": 6, 3294 - "loc": { 3295 - "end": { 3296 - "column": 1, 3297 - "line": 31, 3298 - }, 3299 - "start": { 3300 - "column": 7, 3301 - "line": 6, 3302 - }, 3303 - }, 3304 - "locations": [ 3305 - { 3306 - "end": { 3307 - "column": 1, 3308 - "line": 31, 3309 - }, 3310 - "start": { 3311 - "column": 7, 3312 - "line": 6, 3313 - }, 3314 - }, 3315 - ], 3316 - "type": "branch", 3317 - }, 3318 - "1": { 3319 - "line": 11, 3320 - "loc": { 3321 - "end": { 3322 - "column": 26, 3323 - "line": 11, 3324 - }, 3325 - "start": { 3326 - "column": 12, 3327 - "line": 11, 3328 - }, 3329 - }, 3330 - "locations": [ 3331 - { 3332 - "end": { 3333 - "column": 26, 3334 - "line": 11, 3335 - }, 3336 - "start": { 3337 - "column": 12, 3338 - "line": 11, 3339 - }, 3340 - }, 3341 - ], 3342 - "type": "branch", 3343 - }, 3344 - "10": { 3345 - "line": 24, 3346 - "loc": { 3347 - "end": { 3348 - "column": 3, 3349 - "line": 27, 3350 - }, 3351 - "start": { 3352 - "column": 33, 3353 - "line": 24, 3354 - }, 3355 - }, 3356 - "locations": [ 3357 - { 3358 - "end": { 3359 - "column": 3, 3360 - "line": 27, 3361 - }, 3362 - "start": { 3363 - "column": 33, 3364 - "line": 24, 3365 - }, 3366 - }, 3367 - ], 3368 - "type": "branch", 3369 - }, 3370 - "2": { 3371 - "line": 11, 3372 - "loc": { 3373 - "end": { 3374 - "column": 3, 3375 - "line": 14, 3376 - }, 3377 - "start": { 3378 - "column": 26, 3379 - "line": 11, 3380 - }, 3381 - }, 3382 - "locations": [ 3383 - { 3384 - "end": { 3385 - "column": 3, 3386 - "line": 14, 3387 - }, 3388 - "start": { 3389 - "column": 26, 3390 - "line": 11, 3391 - }, 3392 - }, 3393 - ], 3394 - "type": "branch", 3395 - }, 3396 - "3": { 3397 - "line": 16, 3398 - "loc": { 3399 - "end": { 3400 - "column": 31, 3401 - "line": 16, 3402 - }, 3403 - "start": { 3404 - "column": 17, 3405 - "line": 16, 3406 - }, 3407 - }, 3408 - "locations": [ 3409 - { 3410 - "end": { 3411 - "column": 31, 3412 - "line": 16, 3413 - }, 3414 - "start": { 3415 - "column": 17, 3416 - "line": 16, 3417 - }, 3418 - }, 3419 - ], 3420 - "type": "branch", 3421 - }, 3422 - "4": { 3423 - "line": 16, 3424 - "loc": { 3425 - "end": { 3426 - "column": 3, 3427 - "line": 19, 3428 - }, 3429 - "start": { 3430 - "column": 31, 3431 - "line": 16, 3432 - }, 3433 - }, 3434 - "locations": [ 3435 - { 3436 - "end": { 3437 - "column": 3, 3438 - "line": 19, 3439 - }, 3440 - "start": { 3441 - "column": 31, 3442 - "line": 16, 3443 - }, 3444 - }, 3445 - ], 3446 - "type": "branch", 3447 - }, 3448 - "5": { 3449 - "line": 20, 3450 - "loc": { 3451 - "end": { 3452 - "column": 33, 3453 - "line": 20, 3454 - }, 3455 - "start": { 3456 - "column": 17, 3457 - "line": 20, 3458 - }, 3459 - }, 3460 - "locations": [ 3461 - { 3462 - "end": { 3463 - "column": 33, 3464 - "line": 20, 3465 - }, 3466 - "start": { 3467 - "column": 17, 3468 - "line": 20, 3469 - }, 3470 - }, 3471 - ], 3472 - "type": "branch", 3473 - }, 3474 - "6": { 3475 - "line": 20, 3476 - "loc": { 3477 - "end": { 3478 - "column": 3, 3479 - "line": 23, 3480 - }, 3481 - "start": { 3482 - "column": 33, 3483 - "line": 20, 3484 - }, 3485 - }, 3486 - "locations": [ 3487 - { 3488 - "end": { 3489 - "column": 3, 3490 - "line": 23, 3491 - }, 3492 - "start": { 3493 - "column": 33, 3494 - "line": 20, 3495 - }, 3496 - }, 3497 - ], 3498 - "type": "branch", 3499 - }, 3500 - "7": { 3501 - "line": 24, 3502 - "loc": { 3503 - "end": { 3504 - "column": 33, 3505 - "line": 24, 3506 - }, 3507 - "start": { 3508 - "column": 17, 3509 - "line": 24, 3510 - }, 3511 - }, 3512 - "locations": [ 3513 - { 3514 - "end": { 3515 - "column": 33, 3516 - "line": 24, 3517 - }, 3518 - "start": { 3519 - "column": 17, 3520 - "line": 24, 3521 - }, 3522 - }, 3523 - ], 3524 - "type": "branch", 3525 - }, 3526 - "8": { 3527 - "line": 24, 3528 - "loc": { 3529 - "end": { 3530 - "column": 1, 3531 - "line": 31, 3532 - }, 3533 - "start": { 3534 - "column": 33, 3535 - "line": 24, 3536 - }, 3537 - }, 3538 - "locations": [ 3539 - { 3540 - "end": { 3541 - "column": 1, 3542 - "line": 31, 3543 - }, 3544 - "start": { 3545 - "column": 33, 3546 - "line": 24, 3547 - }, 3548 - }, 3549 - ], 3550 - "type": "branch", 3551 - }, 3552 - "9": { 3553 - "line": 16, 3554 - "loc": { 3555 - "end": { 3556 - "column": 1, 3557 - "line": 31, 3558 - }, 3559 - "start": { 3560 - "column": 31, 3561 - "line": 16, 3562 - }, 3563 - }, 3564 - "locations": [ 3565 - { 3566 - "end": { 3567 - "column": 1, 3568 - "line": 31, 3569 - }, 3570 - "start": { 3571 - "column": 31, 3572 - "line": 16, 3573 - }, 3574 - }, 3575 - ], 3576 - "type": "branch", 3577 - }, 3578 - }, 3579 - "f": { 3580 - "0": 4, 3581 - }, 3582 - "fnMap": { 3583 - "0": { 3584 - "decl": { 3585 - "end": { 3586 - "column": 1, 3587 - "line": 31, 3588 - }, 3589 - "start": { 3590 - "column": 7, 3591 - "line": 6, 3592 - }, 3593 - }, 3594 - "line": 6, 3595 - "loc": { 3596 - "end": { 3597 - "column": 1, 3598 - "line": 31, 3599 - }, 3600 - "start": { 3601 - "column": 7, 3602 - "line": 6, 3603 - }, 3604 - }, 3605 - "name": "sum", 3606 - }, 3607 - }, 3608 - "path": "<process-cwd>/src/multi-environment.ts", 3609 - "s": { 3610 - "0": 2, 3611 - "1": 2, 3612 - "10": 0, 3613 - "11": 3, 3614 - "12": 1, 3615 - "13": 1, 3616 - "14": 2, 3617 - "15": 2, 3618 - "2": 4, 3619 - "3": 0, 3620 - "4": 0, 3621 - "5": 4, 3622 - "6": 1, 3623 - "7": 1, 3624 - "8": 3, 3625 - "9": 0, 3626 - }, 3627 - "statementMap": { 3628 - "0": { 3629 - "end": { 3630 - "column": 40, 3631 - "line": 4, 3632 - }, 3633 - "start": { 3634 - "column": 0, 3635 - "line": 4, 3636 - }, 3637 - }, 3638 - "1": { 3639 - "end": { 3640 - "column": 43, 3641 - "line": 6, 3642 - }, 3643 - "start": { 3644 - "column": 0, 3645 - "line": 6, 3646 - }, 3647 - }, 3648 - "10": { 3649 - "end": { 3650 - "column": 3, 3651 - "line": 23, 3652 - }, 3653 - "start": { 3654 - "column": 0, 3655 - "line": 23, 3656 - }, 3657 - }, 3658 - "11": { 3659 - "end": { 3660 - "column": 34, 3661 - "line": 24, 3662 - }, 3663 - "start": { 3664 - "column": 0, 3665 - "line": 24, 3666 - }, 3667 - }, 3668 - "12": { 3669 - "end": { 3670 - "column": 13, 3671 - "line": 26, 3672 - }, 3673 - "start": { 3674 - "column": 0, 3675 - "line": 26, 3676 - }, 3677 - }, 3678 - "13": { 3679 - "end": { 3680 - "column": 3, 3681 - "line": 27, 3682 - }, 3683 - "start": { 3684 - "column": 0, 3685 - "line": 27, 3686 - }, 3687 - }, 3688 - "14": { 3689 - "end": { 3690 - "column": 14, 3691 - "line": 30, 3692 - }, 3693 - "start": { 3694 - "column": 0, 3695 - "line": 30, 3696 - }, 3697 - }, 3698 - "15": { 3699 - "end": { 3700 - "column": 1, 3701 - "line": 31, 3702 - }, 3703 - "start": { 3704 - "column": 0, 3705 - "line": 31, 3706 - }, 3707 - }, 3708 - "2": { 3709 - "end": { 3710 - "column": 27, 3711 - "line": 11, 3712 - }, 3713 - "start": { 3714 - "column": 0, 3715 - "line": 11, 3716 - }, 3717 - }, 3718 - "3": { 3719 - "end": { 3720 - "column": 13, 3721 - "line": 13, 3722 - }, 3723 - "start": { 3724 - "column": 0, 3725 - "line": 13, 3726 - }, 3727 - }, 3728 - "4": { 3729 - "end": { 3730 - "column": 3, 3731 - "line": 14, 3732 - }, 3733 - "start": { 3734 - "column": 0, 3735 - "line": 14, 3736 - }, 3737 - }, 3738 - "5": { 3739 - "end": { 3740 - "column": 32, 3741 - "line": 16, 3742 - }, 3743 - "start": { 3744 - "column": 0, 3745 - "line": 16, 3746 - }, 3747 - }, 3748 - "6": { 3749 - "end": { 3750 - "column": 12, 3751 - "line": 18, 3752 - }, 3753 - "start": { 3754 - "column": 0, 3755 - "line": 18, 3756 - }, 3757 - }, 3758 - "7": { 3759 - "end": { 3760 - "column": 3, 3761 - "line": 19, 3762 - }, 3763 - "start": { 3764 - "column": 0, 3765 - "line": 19, 3766 - }, 3767 - }, 3768 - "8": { 3769 - "end": { 3770 - "column": 34, 3771 - "line": 20, 3772 - }, 3773 - "start": { 3774 - "column": 0, 3775 - "line": 20, 3776 - }, 3777 - }, 3778 - "9": { 3779 - "end": { 3780 - "column": 13, 3781 - "line": 22, 3782 - }, 3783 - "start": { 3784 - "column": 0, 3785 - "line": 22, 3786 - }, 3787 - }, 3788 - }, 3789 - }, 3790 - "<process-cwd>/src/multi-suite.ts": { 3791 - "all": false, 3792 - "b": { 3793 - "0": [ 3794 - 1, 3795 - ], 3796 - "1": [ 3797 - 1, 3798 - ], 3799 - }, 3800 - "branchMap": { 3801 - "0": { 3802 - "line": 2, 3803 - "loc": { 3804 - "end": { 3805 - "column": 4, 3806 - "line": 4, 3807 - }, 3808 - "start": { 3809 - "column": 2, 3810 - "line": 2, 3811 - }, 3812 - }, 3813 - "locations": [ 3814 - { 3815 - "end": { 3816 - "column": 4, 3817 - "line": 4, 3818 - }, 3819 - "start": { 3820 - "column": 2, 3821 - "line": 2, 3822 - }, 3823 - }, 3824 - ], 3825 - "type": "branch", 3826 - }, 3827 - "1": { 3828 - "line": 6, 3829 - "loc": { 3830 - "end": { 3831 - "column": 4, 3832 - "line": 8, 3833 - }, 3834 - "start": { 3835 - "column": 2, 3836 - "line": 6, 3837 - }, 3838 - }, 3839 - "locations": [ 3840 - { 3841 - "end": { 3842 - "column": 4, 3843 - "line": 8, 3844 - }, 3845 - "start": { 3846 - "column": 2, 3847 - "line": 6, 3848 - }, 3849 - }, 3850 - ], 3851 - "type": "branch", 3852 - }, 3853 - }, 3854 - "f": { 3855 - "0": 1, 3856 - "1": 1, 3857 - }, 3858 - "fnMap": { 3859 - "0": { 3860 - "decl": { 3861 - "end": { 3862 - "column": 4, 3863 - "line": 4, 3864 - }, 3865 - "start": { 3866 - "column": 2, 3867 - "line": 2, 3868 - }, 3869 - }, 3870 - "line": 2, 3871 - "loc": { 3872 - "end": { 3873 - "column": 4, 3874 - "line": 4, 3875 - }, 3876 - "start": { 3877 - "column": 2, 3878 - "line": 2, 3879 - }, 3880 - }, 3881 - "name": "func1", 3882 - }, 3883 - "1": { 3884 - "decl": { 3885 - "end": { 3886 - "column": 4, 3887 - "line": 8, 3888 - }, 3889 - "start": { 3890 - "column": 2, 3891 - "line": 6, 3892 - }, 3893 - }, 3894 - "line": 6, 3895 - "loc": { 3896 - "end": { 3897 - "column": 4, 3898 - "line": 8, 3899 - }, 3900 - "start": { 3901 - "column": 2, 3902 - "line": 6, 3903 - }, 3904 - }, 3905 - "name": "func2", 3906 - }, 3907 - }, 3908 - "path": "<process-cwd>/src/multi-suite.ts", 3909 - "s": { 3910 - "0": 1, 3911 - "1": 1, 3912 - "2": 1, 3913 - "3": 1, 3914 - "5": 1, 3915 - "6": 1, 3916 - "7": 1, 3917 - "8": 1, 3918 - }, 3919 - "statementMap": { 3920 - "0": { 3921 - "end": { 3922 - "column": 16, 3923 - "line": 1, 3924 - }, 3925 - "start": { 3926 - "column": 0, 3927 - "line": 1, 3928 - }, 3929 - }, 3930 - "1": { 3931 - "end": { 3932 - "column": 22, 3933 - "line": 2, 3934 - }, 3935 - "start": { 3936 - "column": 0, 3937 - "line": 2, 3938 - }, 3939 - }, 3940 - "2": { 3941 - "end": { 3942 - "column": 15, 3943 - "line": 3, 3944 - }, 3945 - "start": { 3946 - "column": 0, 3947 - "line": 3, 3948 - }, 3949 - }, 3950 - "3": { 3951 - "end": { 3952 - "column": 4, 3953 - "line": 4, 3954 - }, 3955 - "start": { 3956 - "column": 0, 3957 - "line": 4, 3958 - }, 3959 - }, 3960 - "5": { 3961 - "end": { 3962 - "column": 22, 3963 - "line": 6, 3964 - }, 3965 - "start": { 3966 - "column": 0, 3967 - "line": 6, 3968 - }, 3969 - }, 3970 - "6": { 3971 - "end": { 3972 - "column": 15, 3973 - "line": 7, 3974 - }, 3975 - "start": { 3976 - "column": 0, 3977 - "line": 7, 3978 - }, 3979 - }, 3980 - "7": { 3981 - "end": { 3982 - "column": 4, 3983 - "line": 8, 3984 - }, 3985 - "start": { 3986 - "column": 0, 3987 - "line": 8, 3988 - }, 3989 - }, 3990 - "8": { 3991 - "end": { 3992 - "column": 1, 3993 - "line": 9, 3994 - }, 3995 - "start": { 3996 - "column": 0, 3997 - "line": 9, 3998 - }, 3999 - }, 4000 - }, 4001 - }, 4002 - "<process-cwd>/src/original.ts": { 4003 - "all": false, 4004 - "b": { 4005 - "0": [ 4006 - 1, 4007 - ], 4008 - "1": [ 4009 - 0, 4010 - ], 4011 - "2": [ 4012 - 0, 4013 - ], 4014 - "3": [ 4015 - 2, 4016 - ], 4017 - }, 4018 - "branchMap": { 4019 - "0": { 4020 - "line": 1, 4021 - "loc": { 4022 - "end": { 4023 - "column": 2, 4024 - "line": 19, 4025 - }, 4026 - "start": { 4027 - "column": 21, 4028 - "line": 1, 4029 - }, 4030 - }, 4031 - "locations": [ 4032 - { 4033 - "end": { 4034 - "column": 2, 4035 - "line": 19, 4036 - }, 4037 - "start": { 4038 - "column": 21, 4039 - "line": 1, 4040 - }, 4041 - }, 4042 - ], 4043 - "type": "branch", 4044 - }, 4045 - "1": { 4046 - "line": 2, 4047 - "loc": { 4048 - "end": { 4049 - "column": 3, 4050 - "line": 5, 4051 - }, 4052 - "start": { 4053 - "column": 11, 4054 - "line": 2, 4055 - }, 4056 - }, 4057 - "locations": [ 4058 - { 4059 - "end": { 4060 - "column": 3, 4061 - "line": 5, 4062 - }, 4063 - "start": { 4064 - "column": 11, 4065 - "line": 2, 4066 - }, 4067 - }, 4068 - ], 4069 - "type": "branch", 4070 - }, 4071 - "2": { 4072 - "line": 10, 4073 - "loc": { 4074 - "end": { 4075 - "column": 3, 4076 - "line": 13, 4077 - }, 4078 - "start": { 4079 - "column": 17, 4080 - "line": 10, 4081 - }, 4082 - }, 4083 - "locations": [ 4084 - { 4085 - "end": { 4086 - "column": 3, 4087 - "line": 13, 4088 - }, 4089 - "start": { 4090 - "column": 17, 4091 - "line": 10, 4092 - }, 4093 - }, 4094 - ], 4095 - "type": "branch", 4096 - }, 4097 - "3": { 4098 - "line": 21, 4099 - "loc": { 4100 - "end": { 4101 - "column": 18, 4102 - "line": 21, 4103 - }, 4104 - "start": { 4105 - "column": 0, 4106 - "line": 21, 4107 - }, 4108 - }, 4109 - "locations": [ 4110 - { 4111 - "end": { 4112 - "column": 18, 4113 - "line": 21, 4114 - }, 4115 - "start": { 4116 - "column": 0, 4117 - "line": 21, 4118 - }, 4119 - }, 4120 - ], 4121 - "type": "branch", 4122 - }, 4123 - }, 4124 - "f": { 4125 - "0": 1, 4126 - "1": 2, 4127 - }, 4128 - "fnMap": { 4129 - "0": { 4130 - "decl": { 4131 - "end": { 4132 - "column": 2, 4133 - "line": 19, 4134 - }, 4135 - "start": { 4136 - "column": 21, 4137 - "line": 1, 4138 - }, 4139 - }, 4140 - "line": 1, 4141 - "loc": { 4142 - "end": { 4143 - "column": 2, 4144 - "line": 19, 4145 - }, 4146 - "start": { 4147 - "column": 21, 4148 - "line": 1, 4149 - }, 4150 - }, 4151 - "name": "hello", 4152 - }, 4153 - "1": { 4154 - "decl": { 4155 - "end": { 4156 - "column": 18, 4157 - "line": 21, 4158 - }, 4159 - "start": { 4160 - "column": 0, 4161 - "line": 21, 4162 - }, 4163 - }, 4164 - "line": 21, 4165 - "loc": { 4166 - "end": { 4167 - "column": 18, 4168 - "line": 21, 4169 - }, 4170 - "start": { 4171 - "column": 0, 4172 - "line": 21, 4173 - }, 4174 - }, 4175 - "name": "noop", 4176 - }, 4177 - }, 4178 - "path": "<process-cwd>/src/original.ts", 4179 - "s": { 4180 - "0": 1, 4181 - "1": 1, 4182 - "10": 0, 4183 - "11": 0, 4184 - "12": 0, 4185 - "14": 1, 4186 - "15": 1, 4187 - "16": 1, 4188 - "17": 1, 4189 - "18": 1, 4190 - "2": 0, 4191 - "20": 2, 4192 - "3": 0, 4193 - "4": 0, 4194 - "6": 1, 4195 - "7": 1, 4196 - "9": 1, 4197 - }, 4198 - "statementMap": { 4199 - "0": { 4200 - "end": { 4201 - "column": 41, 4202 - "line": 1, 4203 - }, 4204 - "start": { 4205 - "column": 0, 4206 - "line": 1, 4207 - }, 4208 - }, 4209 - "1": { 4210 - "end": { 4211 - "column": 12, 4212 - "line": 2, 4213 - }, 4214 - "start": { 4215 - "column": 0, 4216 - "line": 2, 4217 - }, 4218 - }, 4219 - "10": { 4220 - "end": { 4221 - "column": 16, 4222 - "line": 11, 4223 - }, 4224 - "start": { 4225 - "column": 0, 4226 - "line": 11, 4227 - }, 4228 - }, 4229 - "11": { 4230 - "end": { 4231 - "column": 11, 4232 - "line": 12, 4233 - }, 4234 - "start": { 4235 - "column": 0, 4236 - "line": 12, 4237 - }, 4238 - }, 4239 - "12": { 4240 - "end": { 4241 - "column": 3, 4242 - "line": 13, 4243 - }, 4244 - "start": { 4245 - "column": 0, 4246 - "line": 13, 4247 - }, 4248 - }, 4249 - "14": { 4250 - "end": { 4251 - "column": 26, 4252 - "line": 15, 4253 - }, 4254 - "start": { 4255 - "column": 0, 4256 - "line": 15, 4257 - }, 4258 - }, 4259 - "15": { 4260 - "end": { 4261 - "column": 14, 4262 - "line": 16, 4263 - }, 4264 - "start": { 4265 - "column": 0, 4266 - "line": 16, 4267 - }, 4268 - }, 4269 - "16": { 4270 - "end": { 4271 - "column": 11, 4272 - "line": 17, 4273 - }, 4274 - "start": { 4275 - "column": 0, 4276 - "line": 17, 4277 - }, 4278 - }, 4279 - "17": { 4280 - "end": { 4281 - "column": 3, 4282 - "line": 18, 4283 - }, 4284 - "start": { 4285 - "column": 0, 4286 - "line": 18, 4287 - }, 4288 - }, 4289 - "18": { 4290 - "end": { 4291 - "column": 2, 4292 - "line": 19, 4293 - }, 4294 - "start": { 4295 - "column": 0, 4296 - "line": 19, 4297 - }, 4298 - }, 4299 - "2": { 4300 - "end": { 4301 - "column": 16, 4302 - "line": 3, 4303 - }, 4304 - "start": { 4305 - "column": 0, 4306 - "line": 3, 4307 - }, 4308 - }, 4309 - "20": { 4310 - "end": { 4311 - "column": 18, 4312 - "line": 21, 4313 - }, 4314 - "start": { 4315 - "column": 0, 4316 - "line": 21, 4317 - }, 4318 - }, 4319 - "3": { 4320 - "end": { 4321 - "column": 11, 4322 - "line": 4, 4323 - }, 4324 - "start": { 4325 - "column": 0, 4326 - "line": 4, 4327 - }, 4328 - }, 4329 - "4": { 4330 - "end": { 4331 - "column": 3, 4332 - "line": 5, 4333 - }, 4334 - "start": { 4335 - "column": 0, 4336 - "line": 5, 4337 - }, 4338 - }, 4339 - "6": { 4340 - "end": { 4341 - "column": 12, 4342 - "line": 7, 4343 - }, 4344 - "start": { 4345 - "column": 0, 4346 - "line": 7, 4347 - }, 4348 - }, 4349 - "7": { 4350 - "end": { 4351 - "column": 9, 4352 - "line": 8, 4353 - }, 4354 - "start": { 4355 - "column": 0, 4356 - "line": 8, 4357 - }, 4358 - }, 4359 - "9": { 4360 - "end": { 4361 - "column": 18, 4362 - "line": 10, 4363 - }, 4364 - "start": { 4365 - "column": 0, 4366 - "line": 10, 4367 - }, 4368 - }, 4369 - }, 4370 - }, 4371 - "<process-cwd>/src/untested-file.ts": { 4372 - "all": true, 4373 - "b": { 4374 - "0": [ 4375 - 1, 4376 - ], 4377 - }, 4378 - "branchMap": { 4379 - "0": { 4380 - "line": 1, 4381 - "loc": { 4382 - "end": { 4383 - "column": 1, 4384 - "line": 47, 4385 - }, 4386 - "start": { 4387 - "column": 984, 4388 - "line": 1, 4389 - }, 4390 - }, 4391 - "locations": [ 4392 - { 4393 - "end": { 4394 - "column": 1, 4395 - "line": 47, 4396 - }, 4397 - "start": { 4398 - "column": 984, 4399 - "line": 1, 4400 - }, 4401 - }, 4402 - ], 4403 - "type": "branch", 4404 - }, 4405 - }, 4406 - "f": { 4407 - "0": 1, 4408 - }, 4409 - "fnMap": { 4410 - "0": { 4411 - "decl": { 4412 - "end": { 4413 - "column": 1, 4414 - "line": 47, 4415 - }, 4416 - "start": { 4417 - "column": 984, 4418 - "line": 1, 4419 - }, 4420 - }, 4421 - "line": 1, 4422 - "loc": { 4423 - "end": { 4424 - "column": 1, 4425 - "line": 47, 4426 - }, 4427 - "start": { 4428 - "column": 984, 4429 - "line": 1, 4430 - }, 4431 - }, 4432 - "name": "(empty-report)", 4433 - }, 4434 - }, 4435 - "path": "<process-cwd>/src/untested-file.ts", 4436 - "s": { 4437 - "11": 0, 4438 - "13": 0, 4439 - "14": 0, 4440 - "18": 0, 4441 - "20": 0, 4442 - "21": 0, 4443 - "23": 0, 4444 - "32": 0, 4445 - "34": 0, 4446 - "35": 0, 4447 - "45": 0, 4448 - "46": 0, 4449 - "7": 0, 4450 - "8": 0, 4451 - "9": 0, 4452 - }, 4453 - "statementMap": { 4454 - "11": { 4455 - "end": { 4456 - "column": 36, 4457 - "line": 12, 4458 - }, 4459 - "start": { 4460 - "column": 0, 4461 - "line": 12, 4462 - }, 4463 - }, 4464 - "13": { 4465 - "end": { 4466 - "column": 14, 4467 - "line": 14, 4468 - }, 4469 - "start": { 4470 - "column": 0, 4471 - "line": 14, 4472 - }, 4473 - }, 4474 - "14": { 4475 - "end": { 4476 - "column": 1, 4477 - "line": 15, 4478 - }, 4479 - "start": { 4480 - "column": 0, 4481 - "line": 15, 4482 - }, 4483 - }, 4484 - "18": { 4485 - "end": { 4486 - "column": 41, 4487 - "line": 19, 4488 - }, 4489 - "start": { 4490 - "column": 0, 4491 - "line": 19, 4492 - }, 4493 - }, 4494 - "20": { 4495 - "end": { 4496 - "column": 14, 4497 - "line": 21, 4498 - }, 4499 - "start": { 4500 - "column": 0, 4501 - "line": 21, 4502 - }, 4503 - }, 4504 - "21": { 4505 - "end": { 4506 - "column": 1, 4507 - "line": 22, 4508 - }, 4509 - "start": { 4510 - "column": 0, 4511 - "line": 22, 4512 - }, 4513 - }, 4514 - "23": { 4515 - "end": { 4516 - "column": 65, 4517 - "line": 24, 4518 - }, 4519 - "start": { 4520 - "column": 0, 4521 - "line": 24, 4522 - }, 4523 - }, 4524 - "32": { 4525 - "end": { 4526 - "column": 25, 4527 - "line": 33, 4528 - }, 4529 - "start": { 4530 - "column": 0, 4531 - "line": 33, 4532 - }, 4533 - }, 4534 - "34": { 4535 - "end": { 4536 - "column": 25, 4537 - "line": 35, 4538 - }, 4539 - "start": { 4540 - "column": 0, 4541 - "line": 35, 4542 - }, 4543 - }, 4544 - "35": { 4545 - "end": { 4546 - "column": 3, 4547 - "line": 36, 4548 - }, 4549 - "start": { 4550 - "column": 0, 4551 - "line": 36, 4552 - }, 4553 - }, 4554 - "45": { 4555 - "end": { 4556 - "column": 41, 4557 - "line": 46, 4558 - }, 4559 - "start": { 4560 - "column": 0, 4561 - "line": 46, 4562 - }, 4563 - }, 4564 - "46": { 4565 - "end": { 4566 - "column": 1, 4567 - "line": 47, 4568 - }, 4569 - "start": { 4570 - "column": 0, 4571 - "line": 47, 4572 - }, 4573 - }, 4574 - "7": { 4575 - "end": { 4576 - "column": 40, 4577 - "line": 8, 4578 - }, 4579 - "start": { 4580 - "column": 0, 4581 - "line": 8, 4582 - }, 4583 - }, 4584 - "8": { 4585 - "end": { 4586 - "column": 72, 4587 - "line": 9, 4588 - }, 4589 - "start": { 4590 - "column": 0, 4591 - "line": 9, 4592 - }, 4593 - }, 4594 - "9": { 4595 - "end": { 4596 - "column": 1, 4597 - "line": 10, 4598 - }, 4599 - "start": { 4600 - "column": 0, 4601 - "line": 10, 4602 - }, 4603 - }, 4604 - }, 4605 - }, 4606 - "<process-cwd>/src/utils.ts": { 4607 - "all": false, 4608 - "b": { 4609 - "0": [ 4610 - 1, 4611 - ], 4612 - "1": [ 4613 - 2, 4614 - ], 4615 - "2": [ 4616 - 1, 4617 - ], 4618 - "3": [ 4619 - 0, 4620 - ], 4621 - }, 4622 - "branchMap": { 4623 - "0": { 4624 - "line": 1, 4625 - "loc": { 4626 - "end": { 4627 - "column": 1, 4628 - "line": 3, 4629 - }, 4630 - "start": { 4631 - "column": 7, 4632 - "line": 1, 4633 - }, 4634 - }, 4635 - "locations": [ 4636 - { 4637 - "end": { 4638 - "column": 1, 4639 - "line": 3, 4640 - }, 4641 - "start": { 4642 - "column": 7, 4643 - "line": 1, 4644 - }, 4645 - }, 4646 - ], 4647 - "type": "branch", 4648 - }, 4649 - "1": { 4650 - "line": 5, 4651 - "loc": { 4652 - "end": { 4653 - "column": 1, 4654 - "line": 7, 4655 - }, 4656 - "start": { 4657 - "column": 7, 4658 - "line": 5, 4659 - }, 4660 - }, 4661 - "locations": [ 4662 - { 4663 - "end": { 4664 - "column": 1, 4665 - "line": 7, 4666 - }, 4667 - "start": { 4668 - "column": 7, 4669 - "line": 5, 4670 - }, 4671 - }, 4672 - ], 4673 - "type": "branch", 4674 - }, 4675 - "2": { 4676 - "line": 14, 4677 - "loc": { 4678 - "end": { 4679 - "column": 1, 4680 - "line": 19, 4681 - }, 4682 - "start": { 4683 - "column": 7, 4684 - "line": 14, 4685 - }, 4686 - }, 4687 - "locations": [ 4688 - { 4689 - "end": { 4690 - "column": 1, 4691 - "line": 19, 4692 - }, 4693 - "start": { 4694 - "column": 7, 4695 - "line": 14, 4696 - }, 4697 - }, 4698 - ], 4699 - "type": "branch", 4700 - }, 4701 - "3": { 4702 - "line": 15, 4703 - "loc": { 4704 - "end": { 4705 - "column": 3, 4706 - "line": 17, 4707 - }, 4708 - "start": { 4709 - "column": 13, 4710 - "line": 15, 4711 - }, 4712 - }, 4713 - "locations": [ 4714 - { 4715 - "end": { 4716 - "column": 3, 4717 - "line": 17, 4718 - }, 4719 - "start": { 4720 - "column": 13, 4721 - "line": 15, 4722 - }, 4723 - }, 4724 - ], 4725 - "type": "branch", 4726 - }, 4727 - }, 4728 - "f": { 4729 - "0": 1, 4730 - "1": 2, 4731 - "2": 0, 4732 - "3": 1, 4733 - "4": 0, 4734 - "5": 1, 4735 - }, 4736 - "fnMap": { 4737 - "0": { 4738 - "decl": { 4739 - "end": { 4740 - "column": 1, 4741 - "line": 3, 4742 - }, 4743 - "start": { 4744 - "column": 7, 4745 - "line": 1, 4746 - }, 4747 - }, 4748 - "line": 1, 4749 - "loc": { 4750 - "end": { 4751 - "column": 1, 4752 - "line": 3, 4753 - }, 4754 - "start": { 4755 - "column": 7, 4756 - "line": 1, 4757 - }, 4758 - }, 4759 - "name": "add", 4760 - }, 4761 - "1": { 4762 - "decl": { 4763 - "end": { 4764 - "column": 1, 4765 - "line": 7, 4766 - }, 4767 - "start": { 4768 - "column": 7, 4769 - "line": 5, 4770 - }, 4771 - }, 4772 - "line": 5, 4773 - "loc": { 4774 - "end": { 4775 - "column": 1, 4776 - "line": 7, 4777 - }, 4778 - "start": { 4779 - "column": 7, 4780 - "line": 5, 4781 - }, 4782 - }, 4783 - "name": "multiply", 4784 - }, 4785 - "2": { 4786 - "decl": { 4787 - "end": { 4788 - "column": 1, 4789 - "line": 12, 4790 - }, 4791 - "start": { 4792 - "column": 7, 4793 - "line": 9, 4794 - }, 4795 - }, 4796 - "line": 9, 4797 - "loc": { 4798 - "end": { 4799 - "column": 1, 4800 - "line": 12, 4801 - }, 4802 - "start": { 4803 - "column": 7, 4804 - "line": 9, 4805 - }, 4806 - }, 4807 - "name": "divide", 4808 - }, 4809 - "3": { 4810 - "decl": { 4811 - "end": { 4812 - "column": 1, 4813 - "line": 19, 4814 - }, 4815 - "start": { 4816 - "column": 7, 4817 - "line": 14, 4818 - }, 4819 - }, 4820 - "line": 14, 4821 - "loc": { 4822 - "end": { 4823 - "column": 1, 4824 - "line": 19, 4825 - }, 4826 - "start": { 4827 - "column": 7, 4828 - "line": 14, 4829 - }, 4830 - }, 4831 - "name": "sqrt", 4832 - }, 4833 - "4": { 4834 - "decl": { 4835 - "end": { 4836 - "column": 1, 4837 - "line": 24, 4838 - }, 4839 - "start": { 4840 - "column": 7, 4841 - "line": 21, 4842 - }, 4843 - }, 4844 - "line": 21, 4845 - "loc": { 4846 - "end": { 4847 - "column": 1, 4848 - "line": 24, 4849 - }, 4850 - "start": { 4851 - "column": 7, 4852 - "line": 21, 4853 - }, 4854 - }, 4855 - "name": "run", 4856 - }, 4857 - "5": { 4858 - "decl": { 4859 - "end": { 4860 - "column": 1, 4861 - "line": 30, 4862 - }, 4863 - "start": { 4864 - "column": 7, 4865 - "line": 28, 4866 - }, 4867 - }, 4868 - "line": 28, 4869 - "loc": { 4870 - "end": { 4871 - "column": 1, 4872 - "line": 30, 4873 - }, 4874 - "start": { 4875 - "column": 7, 4876 - "line": 28, 4877 - }, 4878 - }, 4879 - "name": "ignoredFunction", 4880 - }, 4881 - }, 4882 - "path": "<process-cwd>/src/utils.ts", 4883 - "s": { 4884 - "0": 1, 4885 - "1": 1, 4886 - "10": 0, 4887 - "11": 0, 4888 - "13": 1, 4889 - "14": 1, 4890 - "15": 0, 4891 - "16": 0, 4892 - "17": 1, 4893 - "18": 1, 4894 - "2": 1, 4895 - "20": 1, 4896 - "22": 0, 4897 - "23": 0, 4898 - "4": 1, 4899 - "5": 2, 4900 - "6": 2, 4901 - "8": 1, 4902 - }, 4903 - "statementMap": { 4904 - "0": { 4905 - "end": { 4906 - "column": 43, 4907 - "line": 1, 4908 - }, 4909 - "start": { 4910 - "column": 0, 4911 - "line": 1, 4912 - }, 4913 - }, 4914 - "1": { 4915 - "end": { 4916 - "column": 14, 4917 - "line": 2, 4918 - }, 4919 - "start": { 4920 - "column": 0, 4921 - "line": 2, 4922 - }, 4923 - }, 4924 - "10": { 4925 - "end": { 4926 - "column": 14, 4927 - "line": 11, 4928 - }, 4929 - "start": { 4930 - "column": 0, 4931 - "line": 11, 4932 - }, 4933 - }, 4934 - "11": { 4935 - "end": { 4936 - "column": 1, 4937 - "line": 12, 4938 - }, 4939 - "start": { 4940 - "column": 0, 4941 - "line": 12, 4942 - }, 4943 - }, 4944 - "13": { 4945 - "end": { 4946 - "column": 33, 4947 - "line": 14, 4948 - }, 4949 - "start": { 4950 - "column": 0, 4951 - "line": 14, 4952 - }, 4953 - }, 4954 - "14": { 4955 - "end": { 4956 - "column": 14, 4957 - "line": 15, 4958 - }, 4959 - "start": { 4960 - "column": 0, 4961 - "line": 15, 4962 - }, 4963 - }, 4964 - "15": { 4965 - "end": { 4966 - "column": 51, 4967 - "line": 16, 4968 - }, 4969 - "start": { 4970 - "column": 0, 4971 - "line": 16, 4972 - }, 4973 - }, 4974 - "16": { 4975 - "end": { 4976 - "column": 3, 4977 - "line": 17, 4978 - }, 4979 - "start": { 4980 - "column": 0, 4981 - "line": 17, 4982 - }, 4983 - }, 4984 - "17": { 4985 - "end": { 4986 - "column": 21, 4987 - "line": 18, 4988 - }, 4989 - "start": { 4990 - "column": 0, 4991 - "line": 18, 4992 - }, 4993 - }, 4994 - "18": { 4995 - "end": { 4996 - "column": 1, 4997 - "line": 19, 4998 - }, 4999 - "start": { 5000 - "column": 0, 5001 - "line": 19, 5002 - }, 5003 - }, 5004 - "2": { 5005 - "end": { 5006 - "column": 1, 5007 - "line": 3, 5008 - }, 5009 - "start": { 5010 - "column": 0, 5011 - "line": 3, 5012 - }, 5013 - }, 5014 - "20": { 5015 - "end": { 5016 - "column": 23, 5017 - "line": 21, 5018 - }, 5019 - "start": { 5020 - "column": 0, 5021 - "line": 21, 5022 - }, 5023 - }, 5024 - "22": { 5025 - "end": { 5026 - "column": 14, 5027 - "line": 23, 5028 - }, 5029 - "start": { 5030 - "column": 0, 5031 - "line": 23, 5032 - }, 5033 - }, 5034 - "23": { 5035 - "end": { 5036 - "column": 1, 5037 - "line": 24, 5038 - }, 5039 - "start": { 5040 - "column": 0, 5041 - "line": 24, 5042 - }, 5043 - }, 5044 - "4": { 5045 - "end": { 5046 - "column": 48, 5047 - "line": 5, 5048 - }, 5049 - "start": { 5050 - "column": 0, 5051 - "line": 5, 5052 - }, 5053 - }, 5054 - "5": { 5055 - "end": { 5056 - "column": 14, 5057 - "line": 6, 5058 - }, 5059 - "start": { 5060 - "column": 0, 5061 - "line": 6, 5062 - }, 5063 - }, 5064 - "6": { 5065 - "end": { 5066 - "column": 1, 5067 - "line": 7, 5068 - }, 5069 - "start": { 5070 - "column": 0, 5071 - "line": 7, 5072 - }, 5073 - }, 5074 - "8": { 5075 - "end": { 5076 - "column": 46, 5077 - "line": 9, 5078 - }, 5079 - "start": { 5080 - "column": 0, 5081 - "line": 9, 5082 - }, 5083 - }, 5084 - }, 5085 - }, 5086 - } 5087 - `;
+40
test/coverage-test/fixtures/configs/vitest.config.decorators.ts
··· 1 + import { defineConfig, mergeConfig } from "vitest/config"; 2 + import swc from "unplugin-swc"; 3 + import type { Plugin } from "vite"; 4 + 5 + import base from "./vitest.config"; 6 + 7 + export default mergeConfig( 8 + base, 9 + defineConfig({ 10 + plugins: [DecoratorsPlugin()], 11 + test: {}, 12 + }) 13 + ); 14 + 15 + function DecoratorsPlugin(): Plugin { 16 + const plugin = swc.vite({ 17 + jsc: { 18 + target: "esnext", 19 + parser: { 20 + syntax: "typescript", 21 + decorators: true, 22 + }, 23 + transform: { 24 + legacyDecorator: true, 25 + decoratorMetadata: true, 26 + }, 27 + }, 28 + }); 29 + 30 + return { 31 + name: "custom-swc-decorator", 32 + enforce: "pre", 33 + transform(code, id, options) { 34 + if (id.endsWith("decorators.ts")) { 35 + // @ts-expect-error -- Ignore complex type 36 + return plugin.transform(code, id, options); 37 + } 38 + }, 39 + }; 40 + }
+43
test/coverage-test/fixtures/configs/vitest.config.multi-transform.ts
··· 1 + import { defineConfig, mergeConfig } from 'vitest/config' 2 + import MagicString from 'magic-string' 3 + import remapping from '@ampproject/remapping' 4 + import type { Plugin } from 'vite' 5 + 6 + import base from './vitest.config' 7 + 8 + export default mergeConfig( 9 + base, 10 + defineConfig({ 11 + plugins: [MultiTransformPlugin()], 12 + test: {} 13 + }) 14 + ) 15 + 16 + /* 17 + * Transforms `multi-environment.ts` differently based on test environment (JSDOM/Node) 18 + * so that there are multiple different source maps for a single file. 19 + * This causes a case where coverage report is incorrect if sourcemaps are not picked based on transform mode. 20 + */ 21 + function MultiTransformPlugin(): Plugin { 22 + return { 23 + name: 'vitest-custom-multi-transform', 24 + enforce: 'pre', 25 + transform(code, id, options) { 26 + if (id.includes('src/multi-environment')) { 27 + const ssr = options?.ssr || false 28 + const transforMode = `transformMode is ${ssr ? 'ssr' : 'csr'}` 29 + const padding = '\n*****'.repeat(ssr ? 0 : 15) 30 + 31 + const transformed = new MagicString(code) 32 + transformed.replace('\'default-padding\'', `\`${transforMode} ${padding}\``) 33 + 34 + const map = remapping( 35 + [transformed.generateMap({ hires: true }), this.getCombinedSourcemap() as any], 36 + () => null, 37 + ) as any 38 + 39 + return { code: transformed.toString(), map } 40 + } 41 + }, 42 + } 43 + }
+24
test/coverage-test/fixtures/configs/vitest.config.thresholds-auto-update.ts
··· 1 + import { defineConfig } from 'vitest/config' 2 + 3 + export default defineConfig({ 4 + test: { 5 + coverage: { 6 + thresholds: { 7 + autoUpdate: true, 8 + 9 + // Global ones 10 + lines: 0.1, 11 + functions: 0.2, 12 + branches: 0.3, 13 + statements: 0.4, 14 + 15 + '**/src/math.ts': { 16 + branches: 0.1, 17 + functions: 0.2, 18 + lines: 0.3, 19 + statements: 0.4 20 + } 21 + } 22 + } 23 + }, 24 + })
+6
test/coverage-test/fixtures/configs/vitest.config.ts
··· 1 + import vue from "@vitejs/plugin-vue"; 2 + import { defineConfig } from 'vitest/config' 3 + 4 + export default defineConfig({ 5 + plugins: [vue()], 6 + })
+43
test/coverage-test/fixtures/configs/vitest.config.virtual-files.ts
··· 1 + import { Plugin, defineConfig, mergeConfig } from 'vitest/config' 2 + 3 + import base from './vitest.config' 4 + 5 + export default mergeConfig( 6 + base, 7 + defineConfig({ 8 + plugins: [VirtualFilesPlugin()], 9 + test: {} 10 + }) 11 + ) 12 + 13 + // Simulates Vite's virtual files: https://vitejs.dev/guide/api-plugin.html#virtual-modules-convention 14 + function VirtualFilesPlugin(): Plugin { 15 + return { 16 + name: 'vitest-custom-virtual-files', 17 + resolveId(id) { 18 + if (id === 'virtual:vitest-custom-virtual-file-1') { 19 + return 'src/virtual:vitest-custom-virtual-file-1.ts' 20 + } 21 + 22 + if (id === '\0vitest-custom-virtual-file-2') { 23 + return 'src/\0vitest-custom-virtual-file-2.ts' 24 + } 25 + }, 26 + load(id) { 27 + if (id === 'src/virtual:vitest-custom-virtual-file-1.ts') { 28 + return ` 29 + const virtualFile = "This file should be excluded from coverage report #1" 30 + export default virtualFile; 31 + ` 32 + } 33 + 34 + // Vitest browser resolves this as "\x00", Node as "__x00__" 35 + if (id === 'src/__x00__vitest-custom-virtual-file-2.ts' || id === 'src/\x00vitest-custom-virtual-file-2.ts') { 36 + return ` 37 + const virtualFile = "This file should be excluded from coverage report #2" 38 + export default virtualFile; 39 + ` 40 + } 41 + }, 42 + } 43 + }
+1
test/coverage-test/fixtures/src/another-setup.ts
··· 1 + console.log('Running another setup in fixtures src')
+27
test/coverage-test/fixtures/src/decorators.ts
··· 1 + // eslint-disable-next-line ts/ban-ts-comment -- so that typecheck doesn't include it 2 + // @ts-nocheck 3 + export class DecoratorsTester { 4 + method(@SomeDecorator parameter: Something) { 5 + if (parameter) { 6 + // Covered line 7 + noop(parameter) 8 + } 9 + 10 + if (parameter === 'uncovered') { 11 + // Uncovered line 12 + noop(parameter) 13 + } 14 + } 15 + } 16 + 17 + function SomeDecorator( 18 + _target: Object, 19 + _propertyKey: string | symbol, 20 + _parameterIndex: number, 21 + ) {} 22 + 23 + type Something = unknown 24 + 25 + function noop(..._args: unknown[]) { 26 + 27 + }
+55
test/coverage-test/fixtures/src/dynamic-files.ts
··· 1 + import { existsSync, rmSync, writeFileSync } from 'node:fs' 2 + import { createRequire } from 'node:module' 3 + import { fileURLToPath } from 'node:url' 4 + 5 + export async function runDynamicFileESM() { 6 + const filename = fileURLToPath(new URL('./dynamic-file-esm.ignore.js', import.meta.url)) 7 + 8 + if (existsSync(filename)) { 9 + rmSync(filename) 10 + } 11 + 12 + writeFileSync(filename, ` 13 + // File created by coverage/fixtures/src/dynamic-files.ts 14 + export function run() { 15 + return "Import works" 16 + } 17 + function uncovered() {} 18 + `.trim(), 'utf-8') 19 + 20 + const { run } = await import(filename) 21 + 22 + if (run() !== 'Import works') { 23 + throw new Error(`Failed to run ${filename}`) 24 + } 25 + 26 + rmSync(filename) 27 + 28 + return "Done" 29 + } 30 + 31 + export async function runDynamicFileCJS() { 32 + const filename = fileURLToPath(new URL('./dynamic-file-cjs.ignore.cjs', import.meta.url)) 33 + 34 + if (existsSync(filename)) { 35 + rmSync(filename) 36 + } 37 + 38 + writeFileSync(filename, ` 39 + // File created by coverage/fixtures/src/dynamic-files.ts 40 + module.exports.run = function run() { 41 + return "Import works" 42 + } 43 + function uncovered() {} 44 + `.trim(), 'utf-8') 45 + 46 + const { run } = createRequire(import.meta.url)(filename) 47 + 48 + if (run() !== 'Import works') { 49 + throw new Error(`Failed to run ${filename}`) 50 + } 51 + 52 + rmSync(filename) 53 + 54 + return "Done" 55 + }
+29
test/coverage-test/fixtures/src/empty-lines.ts
··· 1 + /* eslint-disable unused-imports/no-unused-vars -- intentional */ 2 + export function add(a: number, b: number) { 3 + /** 4 + * Multi 5 + * line 6 + * comment 7 + */ 8 + if (a === 2 && b === 3) { 9 + // This line should NOT be covered 10 + return 5 11 + } 12 + 13 + type TypescriptTypings = 1 | 2 14 + 15 + if (a === 1 && b === 1) { 16 + // This line should NOT be covered 17 + return 2 18 + } 19 + 20 + interface MoreCompileTimeCode { 21 + should: { 22 + be: { 23 + excluded: true 24 + } 25 + } 26 + } 27 + 28 + return a + b 29 + }
+7
test/coverage-test/fixtures/src/even.ts
··· 1 + export function isEven(a: number) { 2 + return a % 2 === 0 3 + } 4 + 5 + export function isOdd(a: number) { 6 + return !isEven(a) 7 + }
+7
test/coverage-test/fixtures/src/file-to-change.ts
··· 1 + export function run() { 2 + return 'This file will be modified by test cases' 3 + } 4 + 5 + export function uncoveredFunction() { 6 + return 1 + 2 7 + }
+18
test/coverage-test/fixtures/src/ignore-hints.ts
··· 1 + /* v8 ignore next 4 */ 2 + /* istanbul ignore next -- @preserve */ 3 + export function first() { 4 + return "First" 5 + } 6 + 7 + export function second() { 8 + return "Second" 9 + } 10 + 11 + // Covered line 12 + second() 13 + 14 + /* v8 ignore next -- Uncovered line v8 */ 15 + second() 16 + 17 + /* istanbul ignore next -- @preserve, Uncovered line istanbul */ 18 + second()
+9
test/coverage-test/fixtures/src/implicit-else.ts
··· 1 + export function implicitElse(condition: boolean) { 2 + let a = 1 3 + 4 + if (condition) { 5 + a = 2 6 + } 7 + 8 + return a 9 + }
+4
test/coverage-test/fixtures/src/import-meta-env.ts
··· 1 + // @ts-nocheck -- untyped 2 + export function useImportEnv() { 3 + return import.meta.env.SOME_VARIABLE 4 + }
+1
test/coverage-test/fixtures/src/load-outside-vite.cjs
··· 1 + module.exports = function noop() {}
+15
test/coverage-test/fixtures/src/math.ts
··· 1 + export function sum(a: number, b: number) { 2 + return a + b 3 + } 4 + 5 + export function subtract(a: number, b: number) { 6 + return a - b 7 + } 8 + 9 + export function multiply(a: number, b: number) { 10 + return a * b 11 + } 12 + 13 + export function remainder(a: number, b:number) { 14 + return a % b 15 + }
+31
test/coverage-test/fixtures/src/multi-environment.ts
··· 1 + /** 2 + * The variable below is modified by custom Vite plugin 3 + */ 4 + export const padding = 'default-padding' 5 + 6 + export function sum(a: number, b: number) { 7 + /* 8 + * These if-branches should show correctly on coverage report. 9 + * Otherwise source maps are off. 10 + */ 11 + if (a === 8 && b === 9) { 12 + // This is not covered by any test 13 + return 17 14 + } 15 + // Comment 16 + else if (a === 2 && b === 2) { 17 + // This is covered by SSR test 18 + return 4 19 + } 20 + else if (a === 11 && b === 22) { 21 + // This is not covered by any test 22 + return 33 23 + } 24 + else if (a === 10 && b === 23) { 25 + // This is covered by Web test 26 + return 33 27 + } 28 + 29 + // This is covered by SSR and Web test, should show 2x hits 30 + return a + b 31 + }
+9
test/coverage-test/fixtures/src/multi-suite.ts
··· 1 + export default { 2 + func1(data: any[]) { 3 + return data 4 + }, 5 + 6 + func2(data: any[]) { 7 + return data 8 + }, 9 + }
+3
test/coverage-test/fixtures/src/types-only.ts
··· 1 + export type First = 'This' | 'file' | 'should' 2 + 3 + export type Second = 'be' | 'excluded' | 'from' | 'report'
+47
test/coverage-test/fixtures/src/untested-file.ts
··· 1 + /* 2 + * Some top level comment which adds some padding. This helps us see 3 + * if sourcemaps are off. 4 + */ 5 + 6 + /* eslint-disable unused-imports/no-unused-vars -- intentional */ 7 + 8 + export default function untestedFile() { 9 + return 'This file should end up in report when {"all": true} is given' 10 + } 11 + 12 + function add(a: number, b: number) { 13 + // This line should NOT be covered 14 + return a + b 15 + } 16 + 17 + type TypescriptTypings = 1 | 2 18 + 19 + function multiply(a: number, b: number) { 20 + // This line should NOT be covered 21 + return a * b 22 + } 23 + 24 + export function math(a: number, b: number, operator: '*' | '+') { 25 + interface MoreCompileTimeCode { 26 + should: { 27 + be: { 28 + excluded: true 29 + } 30 + } 31 + } 32 + 33 + if (operator === '*') { 34 + // This line should NOT be covered 35 + return multiply(a, b) 36 + } 37 + 38 + /* v8 ignore start */ 39 + if (operator === '+') { 40 + // This line should be excluded 41 + return add(a, b) 42 + } 43 + /* v8 ignore stop */ 44 + 45 + // This line should NOT be covered 46 + throw new Error('Unsupported operator') 47 + }
+10
test/coverage-test/fixtures/src/virtual-files.ts
··· 1 + // @ts-expect-error -- untyped virtual file provided by custom plugin 2 + import virtualFile1 from 'virtual:vitest-custom-virtual-file-1' 3 + 4 + 5 + // @ts-expect-error -- untyped virtual file provided by custom plugin 6 + import virtualFile2 from '\0vitest-custom-virtual-file-2' 7 + 8 + export function getVirtualFileImports() { 9 + return { virtualFile1, virtualFile2 } 10 + }
+6
test/coverage-test/fixtures/test/even.test.ts
··· 1 + import { expect, test } from 'vitest' 2 + import { isEven } from '../src/even' 3 + 4 + test('isEven', () => { 5 + expect(isEven(6)).toBe(true) 6 + })
+6
test/coverage-test/fixtures/test/file-to-change.test.ts
··· 1 + import { test } from 'vitest' 2 + import { run } from '../src/file-to-change' 3 + 4 + test('test case for changed file', () => { 5 + run() 6 + })
+7
test/coverage-test/fixtures/test/ignore-hints-fixture.test.ts
··· 1 + import { test, expect} from "vitest"; 2 + import { first, second } from '../src/ignore-hints'; 3 + 4 + test("cover some lines", () => { 5 + expect(first()).toBe("First") 6 + expect(second()).toBe("Second") 7 + })
+6
test/coverage-test/fixtures/test/math.test.ts
··· 1 + import { expect, test } from 'vitest' 2 + import { sum } from '../src/math' 3 + 4 + test('sum', () => { 5 + expect(sum(1, 2)).toBe(3) 6 + })
+6
test/coverage-test/fixtures/test/merge-fixture-1.test.ts
··· 1 + import { expect, test } from 'vitest' 2 + import { sum } from '../src/math' 3 + 4 + test('cover sum', () => { 5 + expect(sum(1, 2)).toBe(3) 6 + })
+6
test/coverage-test/fixtures/test/merge-fixture-2.test.ts
··· 1 + import { expect, test } from 'vitest' 2 + import { multiply } from '../src/math' 3 + 4 + test('cover multiply', () => { 5 + expect(multiply(3, 2)).toBe(6) 6 + })
+11
test/coverage-test/fixtures/test/merge-fixture-3.test.ts
··· 1 + import { expect, test } from 'vitest' 2 + import { isEven } from '../src/even' 3 + import { multiply } from '../src/math' 4 + 5 + test('cover multiply again', () => { 6 + expect(multiply(20, 2)).toBe(40) 7 + }) 8 + 9 + test('also cover another file', () => { 10 + expect(isEven(4)).toBe(true) 11 + })
+10
test/coverage-test/fixtures/test/mocking-in-js-file.test.js
··· 1 + import { expect, test, vi } from 'vitest' 2 + import { add } from '../src/math' 3 + 4 + vi.mock('../src/math', async () => ({ 5 + add: vi.fn().mockReturnValue('mocked'), 6 + })) 7 + 8 + test('mocking in Javascript test should not break sourcemaps', () => { 9 + expect(add(1, 2)).toBe('mocked') 10 + })
+9
test/coverage-test/fixtures/test/multi-environment-fixture-ssr.test.ts
··· 1 + // @vitest-environment node 2 + 3 + import { expect, test } from 'vitest' 4 + import { sum } from '../src/multi-environment' 5 + 6 + test('runs on server', () => { 7 + expect(sum(2, 2)).toBe(4) 8 + expect(sum(100, 200)).toBe(300) 9 + })
+9
test/coverage-test/fixtures/test/multi-environment-fixture-web.test.ts
··· 1 + // @vitest-environment jsdom 2 + 3 + import { expect, test } from 'vitest' 4 + import { sum } from '../src/multi-environment' 5 + 6 + test('runs on client', () => { 7 + expect(sum(1, 2)).toBe(3) 8 + expect(sum(10, 23)).toBe(33) 9 + })
+20
test/coverage-test/fixtures/test/multi-suite-fixture.test.ts
··· 1 + import { describe, expect, test } from "vitest" 2 + import MultiSuite from '../src/multi-suite' 3 + 4 + describe('Multiple test suites', () => { 5 + describe('suite for func1', () => { 6 + test('func1', () => { 7 + const data = ['a', 'b'] 8 + const val = MultiSuite.func1(data) 9 + expect(val).toEqual(data) 10 + }) 11 + }) 12 + 13 + describe('suite for func2', () => { 14 + test('func2', () => { 15 + const data = ['c', 'd'] 16 + const val = MultiSuite.func2(data) 17 + expect(val).toEqual(data) 18 + }) 19 + }) 20 + })
+10
test/coverage-test/fixtures/test/virtual-files-fixture.test.ts
··· 1 + import { expect, test } from 'vitest' 2 + import { getVirtualFileImports} from '../src/virtual-files' 3 + 4 + test("verify virtual files work", () => { 5 + const {virtualFile1, virtualFile2} = getVirtualFileImports() 6 + 7 + expect(virtualFile1).toBe('This file should be excluded from coverage report #1') 8 + expect(virtualFile2).toBe('This file should be excluded from coverage report #2') 9 + 10 + })
+52
test/coverage-test/fixtures/test/vue-fixture.test.ts
··· 1 + /** 2 + * @vitest-environment happy-dom 3 + */ 4 + 5 + import { expect, test, vi } from 'vitest' 6 + import { mount } from '@vue/test-utils' 7 + import Hello from '../src/Vue/Hello.vue' 8 + import Defined from '../src/Vue/Defined.vue' 9 + import { CounterVue } from '../src/Vue/Counter' 10 + 11 + test('vue 3 coverage', async () => { 12 + expect(Hello).toBeTruthy() 13 + 14 + const wrapper = mount(Hello, { 15 + props: { 16 + count: 4, 17 + }, 18 + }) 19 + 20 + expect(wrapper.text()).toContain('4 x 2 = 8') 21 + expect(wrapper.html()).toMatchInlineSnapshot(` 22 + "<div>4 x 2 = 8</div> 23 + <button> x1 </button>" 24 + `) 25 + 26 + await wrapper.get('button').trigger('click') 27 + 28 + await vi.waitFor(() => { 29 + expect(wrapper.text()).toContain('4 x 3 = 12') 30 + }) 31 + 32 + await wrapper.get('button').trigger('click') 33 + 34 + await vi.waitFor(() => { 35 + expect(wrapper.text()).toContain('4 x 4 = 16') 36 + }) 37 + }) 38 + 39 + test('define package in vm', () => { 40 + expect(Defined).toBeTruthy() 41 + 42 + const wrapper = mount(Defined) 43 + 44 + expect(wrapper.text()).toContain('hello') 45 + }) 46 + 47 + test('vue non-SFC, uses query parameters in file imports', async () => { 48 + const wrapper = mount(CounterVue) 49 + 50 + await wrapper.find('button').trigger('click') 51 + expect(wrapper.text()).contain(1) 52 + })
-5
test/coverage-test/src/.should-be-excluded-from-coverage/excluded-from-coverage.ts
··· 1 - // This file should be excluded from coverage report 2 - 3 - export function uncoveredFile() { 4 - return 0 5 - }
-24
test/coverage-test/src/Counter/Counter.component.ts
··· 1 - import { defineComponent, ref } from 'vue' 2 - 3 - export default defineComponent({ 4 - name: 'Counter', 5 - 6 - setup() { 7 - const count = ref(0) 8 - return { count } 9 - }, 10 - 11 - methods: { 12 - uncoveredMethod() { 13 - return 'This line should not be covered' 14 - }, 15 - 16 - coveredMethod() { 17 - return 'This line should be covered' 18 - }, 19 - 20 - uncoveredMethodUsingImportMeta() { 21 - return `Source maps tend to break when import meta is used: ${import.meta.env.BASE_URL}` 22 - }, 23 - }, 24 - })
-14
test/coverage-test/src/Counter/Counter.vue
··· 1 - <script lang="ts" src="./Counter.component.ts"></script> 2 - 3 - <template> 4 - <button @click="count++"> 5 - {{ count }} 6 - </button> 7 - 8 - <div v-if="count > 10"> 9 - {{ uncoveredMethod() }} 10 - </div> 11 - <div v-else> 12 - {{ coveredMethod() }} 13 - </div> 14 - </template>
-3
test/coverage-test/src/Counter/index.ts
··· 1 - import CounterVue from './Counter.vue' 2 - 3 - export { CounterVue }
+270
test/coverage-test/test/__snapshots__/pre-transpiled-istanbul.snapshot.json
··· 1 + { 2 + "<process-cwd>/fixtures/src/pre-transpiled/original.ts": { 3 + "path": "<process-cwd>/fixtures/src/pre-transpiled/original.ts", 4 + "statementMap": { 5 + "0": { 6 + "start": { 7 + "line": 1, 8 + "column": 21 9 + }, 10 + "end": { 11 + "line": 19, 12 + "column": 1 13 + } 14 + }, 15 + "1": { 16 + "start": { 17 + "line": 2, 18 + "column": 2 19 + }, 20 + "end": { 21 + "line": 5, 22 + "column": 3 23 + } 24 + }, 25 + "2": { 26 + "start": { 27 + "line": 4, 28 + "column": 4 29 + }, 30 + "end": { 31 + "line": 4, 32 + "column": 11 33 + } 34 + }, 35 + "3": { 36 + "start": { 37 + "line": 8, 38 + "column": 2 39 + }, 40 + "end": { 41 + "line": 8, 42 + "column": 9 43 + } 44 + }, 45 + "4": { 46 + "start": { 47 + "line": 10, 48 + "column": 2 49 + }, 50 + "end": { 51 + "line": 13, 52 + "column": 3 53 + } 54 + }, 55 + "5": { 56 + "start": { 57 + "line": 12, 58 + "column": 4 59 + }, 60 + "end": { 61 + "line": 12, 62 + "column": 11 63 + } 64 + }, 65 + "6": { 66 + "start": { 67 + "line": 15, 68 + "column": 2 69 + }, 70 + "end": { 71 + "line": 18, 72 + "column": 3 73 + } 74 + }, 75 + "7": { 76 + "start": { 77 + "line": 17, 78 + "column": 4 79 + }, 80 + "end": { 81 + "line": 17, 82 + "column": 11 83 + } 84 + } 85 + }, 86 + "fnMap": { 87 + "0": { 88 + "name": "(anonymous_0)", 89 + "decl": { 90 + "start": { 91 + "line": 1, 92 + "column": 21 93 + }, 94 + "end": { 95 + "line": 1, 96 + "column": 22 97 + } 98 + }, 99 + "loc": { 100 + "start": { 101 + "line": 1, 102 + "column": 35 103 + }, 104 + "end": { 105 + "line": 19, 106 + "column": 1 107 + } 108 + } 109 + }, 110 + "1": { 111 + "name": "noop", 112 + "decl": { 113 + "start": { 114 + "line": 21, 115 + "column": 9 116 + }, 117 + "end": { 118 + "line": 21, 119 + "column": 13 120 + } 121 + }, 122 + "loc": { 123 + "start": { 124 + "line": 21, 125 + "column": 13 126 + }, 127 + "end": { 128 + "line": 21, 129 + "column": 18 130 + } 131 + } 132 + } 133 + }, 134 + "branchMap": { 135 + "0": { 136 + "loc": { 137 + "start": { 138 + "line": 2, 139 + "column": 2 140 + }, 141 + "end": { 142 + "line": 5, 143 + "column": 3 144 + } 145 + }, 146 + "type": "if", 147 + "locations": [ 148 + { 149 + "start": { 150 + "line": 2, 151 + "column": 2 152 + }, 153 + "end": { 154 + "line": 5, 155 + "column": 3 156 + } 157 + }, 158 + { 159 + "start": { 160 + "line": 2, 161 + "column": 2 162 + }, 163 + "end": { 164 + "line": 5, 165 + "column": 3 166 + } 167 + } 168 + ] 169 + }, 170 + "1": { 171 + "loc": { 172 + "start": { 173 + "line": 10, 174 + "column": 2 175 + }, 176 + "end": { 177 + "line": 13, 178 + "column": 3 179 + } 180 + }, 181 + "type": "if", 182 + "locations": [ 183 + { 184 + "start": { 185 + "line": 10, 186 + "column": 2 187 + }, 188 + "end": { 189 + "line": 13, 190 + "column": 3 191 + } 192 + }, 193 + { 194 + "start": { 195 + "line": 10, 196 + "column": 2 197 + }, 198 + "end": { 199 + "line": 13, 200 + "column": 3 201 + } 202 + } 203 + ] 204 + }, 205 + "2": { 206 + "loc": { 207 + "start": { 208 + "line": 15, 209 + "column": 2 210 + }, 211 + "end": { 212 + "line": 18, 213 + "column": 3 214 + } 215 + }, 216 + "type": "if", 217 + "locations": [ 218 + { 219 + "start": { 220 + "line": 15, 221 + "column": 2 222 + }, 223 + "end": { 224 + "line": 18, 225 + "column": 3 226 + } 227 + }, 228 + { 229 + "start": { 230 + "line": 15, 231 + "column": 2 232 + }, 233 + "end": { 234 + "line": 18, 235 + "column": 3 236 + } 237 + } 238 + ] 239 + } 240 + }, 241 + "s": { 242 + "0": 1, 243 + "1": 1, 244 + "2": 0, 245 + "3": 1, 246 + "4": 1, 247 + "5": 0, 248 + "6": 1, 249 + "7": 1 250 + }, 251 + "f": { 252 + "0": 1, 253 + "1": 2 254 + }, 255 + "b": { 256 + "0": [ 257 + 0, 258 + 1 259 + ], 260 + "1": [ 261 + 0, 262 + 1 263 + ], 264 + "2": [ 265 + 1, 266 + 0 267 + ] 268 + } 269 + } 270 + }
+371
test/coverage-test/test/__snapshots__/pre-transpiled-v8.snapshot.json
··· 1 + { 2 + "<process-cwd>/fixtures/src/pre-transpiled/original.ts": { 3 + "path": "<process-cwd>/fixtures/src/pre-transpiled/original.ts", 4 + "all": false, 5 + "statementMap": { 6 + "0": { 7 + "start": { 8 + "line": 1, 9 + "column": 0 10 + }, 11 + "end": { 12 + "line": 1, 13 + "column": 41 14 + } 15 + }, 16 + "1": { 17 + "start": { 18 + "line": 2, 19 + "column": 0 20 + }, 21 + "end": { 22 + "line": 2, 23 + "column": 12 24 + } 25 + }, 26 + "2": { 27 + "start": { 28 + "line": 3, 29 + "column": 0 30 + }, 31 + "end": { 32 + "line": 3, 33 + "column": 16 34 + } 35 + }, 36 + "3": { 37 + "start": { 38 + "line": 4, 39 + "column": 0 40 + }, 41 + "end": { 42 + "line": 4, 43 + "column": 11 44 + } 45 + }, 46 + "4": { 47 + "start": { 48 + "line": 5, 49 + "column": 0 50 + }, 51 + "end": { 52 + "line": 5, 53 + "column": 3 54 + } 55 + }, 56 + "6": { 57 + "start": { 58 + "line": 7, 59 + "column": 0 60 + }, 61 + "end": { 62 + "line": 7, 63 + "column": 12 64 + } 65 + }, 66 + "7": { 67 + "start": { 68 + "line": 8, 69 + "column": 0 70 + }, 71 + "end": { 72 + "line": 8, 73 + "column": 9 74 + } 75 + }, 76 + "9": { 77 + "start": { 78 + "line": 10, 79 + "column": 0 80 + }, 81 + "end": { 82 + "line": 10, 83 + "column": 18 84 + } 85 + }, 86 + "10": { 87 + "start": { 88 + "line": 11, 89 + "column": 0 90 + }, 91 + "end": { 92 + "line": 11, 93 + "column": 16 94 + } 95 + }, 96 + "11": { 97 + "start": { 98 + "line": 12, 99 + "column": 0 100 + }, 101 + "end": { 102 + "line": 12, 103 + "column": 11 104 + } 105 + }, 106 + "12": { 107 + "start": { 108 + "line": 13, 109 + "column": 0 110 + }, 111 + "end": { 112 + "line": 13, 113 + "column": 3 114 + } 115 + }, 116 + "14": { 117 + "start": { 118 + "line": 15, 119 + "column": 0 120 + }, 121 + "end": { 122 + "line": 15, 123 + "column": 26 124 + } 125 + }, 126 + "15": { 127 + "start": { 128 + "line": 16, 129 + "column": 0 130 + }, 131 + "end": { 132 + "line": 16, 133 + "column": 14 134 + } 135 + }, 136 + "16": { 137 + "start": { 138 + "line": 17, 139 + "column": 0 140 + }, 141 + "end": { 142 + "line": 17, 143 + "column": 11 144 + } 145 + }, 146 + "17": { 147 + "start": { 148 + "line": 18, 149 + "column": 0 150 + }, 151 + "end": { 152 + "line": 18, 153 + "column": 3 154 + } 155 + }, 156 + "18": { 157 + "start": { 158 + "line": 19, 159 + "column": 0 160 + }, 161 + "end": { 162 + "line": 19, 163 + "column": 2 164 + } 165 + }, 166 + "20": { 167 + "start": { 168 + "line": 21, 169 + "column": 0 170 + }, 171 + "end": { 172 + "line": 21, 173 + "column": 18 174 + } 175 + } 176 + }, 177 + "s": { 178 + "0": 1, 179 + "1": 1, 180 + "2": 0, 181 + "3": 0, 182 + "4": 0, 183 + "6": 1, 184 + "7": 1, 185 + "9": 1, 186 + "10": 0, 187 + "11": 0, 188 + "12": 0, 189 + "14": 1, 190 + "15": 1, 191 + "16": 1, 192 + "17": 1, 193 + "18": 1, 194 + "20": 2 195 + }, 196 + "branchMap": { 197 + "0": { 198 + "type": "branch", 199 + "line": 1, 200 + "loc": { 201 + "start": { 202 + "line": 1, 203 + "column": 21 204 + }, 205 + "end": { 206 + "line": 19, 207 + "column": 2 208 + } 209 + }, 210 + "locations": [ 211 + { 212 + "start": { 213 + "line": 1, 214 + "column": 21 215 + }, 216 + "end": { 217 + "line": 19, 218 + "column": 2 219 + } 220 + } 221 + ] 222 + }, 223 + "1": { 224 + "type": "branch", 225 + "line": 2, 226 + "loc": { 227 + "start": { 228 + "line": 2, 229 + "column": 11 230 + }, 231 + "end": { 232 + "line": 5, 233 + "column": 3 234 + } 235 + }, 236 + "locations": [ 237 + { 238 + "start": { 239 + "line": 2, 240 + "column": 11 241 + }, 242 + "end": { 243 + "line": 5, 244 + "column": 3 245 + } 246 + } 247 + ] 248 + }, 249 + "2": { 250 + "type": "branch", 251 + "line": 10, 252 + "loc": { 253 + "start": { 254 + "line": 10, 255 + "column": 17 256 + }, 257 + "end": { 258 + "line": 13, 259 + "column": 3 260 + } 261 + }, 262 + "locations": [ 263 + { 264 + "start": { 265 + "line": 10, 266 + "column": 17 267 + }, 268 + "end": { 269 + "line": 13, 270 + "column": 3 271 + } 272 + } 273 + ] 274 + }, 275 + "3": { 276 + "type": "branch", 277 + "line": 21, 278 + "loc": { 279 + "start": { 280 + "line": 21, 281 + "column": 0 282 + }, 283 + "end": { 284 + "line": 21, 285 + "column": 18 286 + } 287 + }, 288 + "locations": [ 289 + { 290 + "start": { 291 + "line": 21, 292 + "column": 0 293 + }, 294 + "end": { 295 + "line": 21, 296 + "column": 18 297 + } 298 + } 299 + ] 300 + } 301 + }, 302 + "b": { 303 + "0": [ 304 + 1 305 + ], 306 + "1": [ 307 + 0 308 + ], 309 + "2": [ 310 + 0 311 + ], 312 + "3": [ 313 + 2 314 + ] 315 + }, 316 + "fnMap": { 317 + "0": { 318 + "name": "hello", 319 + "decl": { 320 + "start": { 321 + "line": 1, 322 + "column": 21 323 + }, 324 + "end": { 325 + "line": 19, 326 + "column": 2 327 + } 328 + }, 329 + "loc": { 330 + "start": { 331 + "line": 1, 332 + "column": 21 333 + }, 334 + "end": { 335 + "line": 19, 336 + "column": 2 337 + } 338 + }, 339 + "line": 1 340 + }, 341 + "1": { 342 + "name": "noop", 343 + "decl": { 344 + "start": { 345 + "line": 21, 346 + "column": 0 347 + }, 348 + "end": { 349 + "line": 21, 350 + "column": 18 351 + } 352 + }, 353 + "loc": { 354 + "start": { 355 + "line": 21, 356 + "column": 0 357 + }, 358 + "end": { 359 + "line": 21, 360 + "column": 18 361 + } 362 + }, 363 + "line": 21 364 + } 365 + }, 366 + "f": { 367 + "0": 1, 368 + "1": 2 369 + } 370 + } 371 + }
+515
test/coverage-test/test/__snapshots__/results-istanbul.snapshot.json
··· 1 + { 2 + "<process-cwd>/fixtures/src/even.ts": { 3 + "path": "<process-cwd>/fixtures/src/even.ts", 4 + "statementMap": { 5 + "0": { 6 + "start": { 7 + "line": 2, 8 + "column": 2 9 + }, 10 + "end": { 11 + "line": 2, 12 + "column": null 13 + } 14 + }, 15 + "1": { 16 + "start": { 17 + "line": 6, 18 + "column": 2 19 + }, 20 + "end": { 21 + "line": 6, 22 + "column": null 23 + } 24 + } 25 + }, 26 + "fnMap": { 27 + "0": { 28 + "name": "isEven", 29 + "decl": { 30 + "start": { 31 + "line": 1, 32 + "column": 16 33 + }, 34 + "end": { 35 + "line": 1, 36 + "column": 23 37 + } 38 + }, 39 + "loc": { 40 + "start": { 41 + "line": 1, 42 + "column": 34 43 + }, 44 + "end": { 45 + "line": 3, 46 + "column": null 47 + } 48 + } 49 + }, 50 + "1": { 51 + "name": "isOdd", 52 + "decl": { 53 + "start": { 54 + "line": 5, 55 + "column": 16 56 + }, 57 + "end": { 58 + "line": 5, 59 + "column": 22 60 + } 61 + }, 62 + "loc": { 63 + "start": { 64 + "line": 5, 65 + "column": 33 66 + }, 67 + "end": { 68 + "line": 7, 69 + "column": null 70 + } 71 + } 72 + } 73 + }, 74 + "branchMap": {}, 75 + "s": { 76 + "0": 1, 77 + "1": 0 78 + }, 79 + "f": { 80 + "0": 1, 81 + "1": 0 82 + }, 83 + "b": {} 84 + }, 85 + "<process-cwd>/fixtures/src/math.ts": { 86 + "path": "<process-cwd>/fixtures/src/math.ts", 87 + "statementMap": { 88 + "0": { 89 + "start": { 90 + "line": 2, 91 + "column": 2 92 + }, 93 + "end": { 94 + "line": 2, 95 + "column": null 96 + } 97 + }, 98 + "1": { 99 + "start": { 100 + "line": 6, 101 + "column": 2 102 + }, 103 + "end": { 104 + "line": 6, 105 + "column": null 106 + } 107 + }, 108 + "2": { 109 + "start": { 110 + "line": 10, 111 + "column": 2 112 + }, 113 + "end": { 114 + "line": 10, 115 + "column": null 116 + } 117 + }, 118 + "3": { 119 + "start": { 120 + "line": 14, 121 + "column": 2 122 + }, 123 + "end": { 124 + "line": 14, 125 + "column": null 126 + } 127 + } 128 + }, 129 + "fnMap": { 130 + "0": { 131 + "name": "sum", 132 + "decl": { 133 + "start": { 134 + "line": 1, 135 + "column": 16 136 + }, 137 + "end": { 138 + "line": 1, 139 + "column": 20 140 + } 141 + }, 142 + "loc": { 143 + "start": { 144 + "line": 1, 145 + "column": 42 146 + }, 147 + "end": { 148 + "line": 3, 149 + "column": null 150 + } 151 + } 152 + }, 153 + "1": { 154 + "name": "subtract", 155 + "decl": { 156 + "start": { 157 + "line": 5, 158 + "column": 16 159 + }, 160 + "end": { 161 + "line": 5, 162 + "column": 25 163 + } 164 + }, 165 + "loc": { 166 + "start": { 167 + "line": 5, 168 + "column": 47 169 + }, 170 + "end": { 171 + "line": 7, 172 + "column": null 173 + } 174 + } 175 + }, 176 + "2": { 177 + "name": "multiply", 178 + "decl": { 179 + "start": { 180 + "line": 9, 181 + "column": 16 182 + }, 183 + "end": { 184 + "line": 9, 185 + "column": 25 186 + } 187 + }, 188 + "loc": { 189 + "start": { 190 + "line": 9, 191 + "column": 47 192 + }, 193 + "end": { 194 + "line": 11, 195 + "column": null 196 + } 197 + } 198 + }, 199 + "3": { 200 + "name": "remainder", 201 + "decl": { 202 + "start": { 203 + "line": 13, 204 + "column": 16 205 + }, 206 + "end": { 207 + "line": 13, 208 + "column": 26 209 + } 210 + }, 211 + "loc": { 212 + "start": { 213 + "line": 13, 214 + "column": 47 215 + }, 216 + "end": { 217 + "line": 15, 218 + "column": null 219 + } 220 + } 221 + } 222 + }, 223 + "branchMap": {}, 224 + "s": { 225 + "0": 1, 226 + "1": 0, 227 + "2": 0, 228 + "3": 0 229 + }, 230 + "f": { 231 + "0": 1, 232 + "1": 0, 233 + "2": 0, 234 + "3": 0 235 + }, 236 + "b": {} 237 + }, 238 + "<process-cwd>/fixtures/src/untested-file.ts": { 239 + "path": "<process-cwd>/fixtures/src/untested-file.ts", 240 + "statementMap": { 241 + "0": { 242 + "start": { 243 + "line": 9, 244 + "column": 2 245 + }, 246 + "end": { 247 + "line": 9, 248 + "column": null 249 + } 250 + }, 251 + "1": { 252 + "start": { 253 + "line": 14, 254 + "column": 2 255 + }, 256 + "end": { 257 + "line": 14, 258 + "column": null 259 + } 260 + }, 261 + "2": { 262 + "start": { 263 + "line": 21, 264 + "column": 2 265 + }, 266 + "end": { 267 + "line": 21, 268 + "column": null 269 + } 270 + }, 271 + "3": { 272 + "start": { 273 + "line": 33, 274 + "column": 2 275 + }, 276 + "end": { 277 + "line": 36, 278 + "column": null 279 + } 280 + }, 281 + "4": { 282 + "start": { 283 + "line": 35, 284 + "column": 4 285 + }, 286 + "end": { 287 + "line": 35, 288 + "column": null 289 + } 290 + }, 291 + "5": { 292 + "start": { 293 + "line": 39, 294 + "column": 2 295 + }, 296 + "end": { 297 + "line": 42, 298 + "column": null 299 + } 300 + }, 301 + "6": { 302 + "start": { 303 + "line": 41, 304 + "column": 4 305 + }, 306 + "end": { 307 + "line": 41, 308 + "column": null 309 + } 310 + }, 311 + "7": { 312 + "start": { 313 + "line": 46, 314 + "column": 2 315 + }, 316 + "end": { 317 + "line": 46, 318 + "column": null 319 + } 320 + } 321 + }, 322 + "fnMap": { 323 + "0": { 324 + "name": "untestedFile", 325 + "decl": { 326 + "start": { 327 + "line": 8, 328 + "column": 24 329 + }, 330 + "end": { 331 + "line": 8, 332 + "column": 39 333 + } 334 + }, 335 + "loc": { 336 + "start": { 337 + "line": 8, 338 + "column": 39 339 + }, 340 + "end": { 341 + "line": 10, 342 + "column": null 343 + } 344 + } 345 + }, 346 + "1": { 347 + "name": "add", 348 + "decl": { 349 + "start": { 350 + "line": 12, 351 + "column": 9 352 + }, 353 + "end": { 354 + "line": 12, 355 + "column": 13 356 + } 357 + }, 358 + "loc": { 359 + "start": { 360 + "line": 12, 361 + "column": 35 362 + }, 363 + "end": { 364 + "line": 15, 365 + "column": null 366 + } 367 + } 368 + }, 369 + "2": { 370 + "name": "multiply", 371 + "decl": { 372 + "start": { 373 + "line": 19, 374 + "column": 9 375 + }, 376 + "end": { 377 + "line": 19, 378 + "column": 18 379 + } 380 + }, 381 + "loc": { 382 + "start": { 383 + "line": 19, 384 + "column": 40 385 + }, 386 + "end": { 387 + "line": 22, 388 + "column": null 389 + } 390 + } 391 + }, 392 + "3": { 393 + "name": "math", 394 + "decl": { 395 + "start": { 396 + "line": 24, 397 + "column": 16 398 + }, 399 + "end": { 400 + "line": 24, 401 + "column": 21 402 + } 403 + }, 404 + "loc": { 405 + "start": { 406 + "line": 24, 407 + "column": 64 408 + }, 409 + "end": { 410 + "line": 47, 411 + "column": null 412 + } 413 + } 414 + } 415 + }, 416 + "branchMap": { 417 + "0": { 418 + "loc": { 419 + "start": { 420 + "line": 33, 421 + "column": 2 422 + }, 423 + "end": { 424 + "line": 36, 425 + "column": null 426 + } 427 + }, 428 + "type": "if", 429 + "locations": [ 430 + { 431 + "start": { 432 + "line": 33, 433 + "column": 2 434 + }, 435 + "end": { 436 + "line": 36, 437 + "column": null 438 + } 439 + }, 440 + { 441 + "start": { 442 + "line": 33, 443 + "column": 2 444 + }, 445 + "end": { 446 + "line": 36, 447 + "column": null 448 + } 449 + } 450 + ] 451 + }, 452 + "1": { 453 + "loc": { 454 + "start": { 455 + "line": 39, 456 + "column": 2 457 + }, 458 + "end": { 459 + "line": 42, 460 + "column": null 461 + } 462 + }, 463 + "type": "if", 464 + "locations": [ 465 + { 466 + "start": { 467 + "line": 39, 468 + "column": 2 469 + }, 470 + "end": { 471 + "line": 42, 472 + "column": null 473 + } 474 + }, 475 + { 476 + "start": { 477 + "line": 39, 478 + "column": 2 479 + }, 480 + "end": { 481 + "line": 42, 482 + "column": null 483 + } 484 + } 485 + ] 486 + } 487 + }, 488 + "s": { 489 + "0": 0, 490 + "1": 0, 491 + "2": 0, 492 + "3": 0, 493 + "4": 0, 494 + "5": 0, 495 + "6": 0, 496 + "7": 0 497 + }, 498 + "f": { 499 + "0": 0, 500 + "1": 0, 501 + "2": 0, 502 + "3": 0 503 + }, 504 + "b": { 505 + "0": [ 506 + 0, 507 + 0 508 + ], 509 + "1": [ 510 + 0, 511 + 0 512 + ] 513 + } 514 + } 515 + }
+675
test/coverage-test/test/__snapshots__/results-v8.snapshot.json
··· 1 + { 2 + "<process-cwd>/fixtures/src/even.ts": { 3 + "path": "<process-cwd>/fixtures/src/even.ts", 4 + "all": false, 5 + "statementMap": { 6 + "0": { 7 + "start": { 8 + "line": 1, 9 + "column": 0 10 + }, 11 + "end": { 12 + "line": 1, 13 + "column": 35 14 + } 15 + }, 16 + "1": { 17 + "start": { 18 + "line": 2, 19 + "column": 0 20 + }, 21 + "end": { 22 + "line": 2, 23 + "column": 20 24 + } 25 + }, 26 + "2": { 27 + "start": { 28 + "line": 3, 29 + "column": 0 30 + }, 31 + "end": { 32 + "line": 3, 33 + "column": 1 34 + } 35 + }, 36 + "4": { 37 + "start": { 38 + "line": 5, 39 + "column": 0 40 + }, 41 + "end": { 42 + "line": 5, 43 + "column": 34 44 + } 45 + }, 46 + "5": { 47 + "start": { 48 + "line": 6, 49 + "column": 0 50 + }, 51 + "end": { 52 + "line": 6, 53 + "column": 19 54 + } 55 + }, 56 + "6": { 57 + "start": { 58 + "line": 7, 59 + "column": 0 60 + }, 61 + "end": { 62 + "line": 7, 63 + "column": 1 64 + } 65 + } 66 + }, 67 + "s": { 68 + "0": 1, 69 + "1": 1, 70 + "2": 1, 71 + "4": 1, 72 + "5": 0, 73 + "6": 0 74 + }, 75 + "branchMap": { 76 + "0": { 77 + "type": "branch", 78 + "line": 1, 79 + "loc": { 80 + "start": { 81 + "line": 1, 82 + "column": 7 83 + }, 84 + "end": { 85 + "line": 3, 86 + "column": 1 87 + } 88 + }, 89 + "locations": [ 90 + { 91 + "start": { 92 + "line": 1, 93 + "column": 7 94 + }, 95 + "end": { 96 + "line": 3, 97 + "column": 1 98 + } 99 + } 100 + ] 101 + } 102 + }, 103 + "b": { 104 + "0": [ 105 + 1 106 + ] 107 + }, 108 + "fnMap": { 109 + "0": { 110 + "name": "isEven", 111 + "decl": { 112 + "start": { 113 + "line": 1, 114 + "column": 7 115 + }, 116 + "end": { 117 + "line": 3, 118 + "column": 1 119 + } 120 + }, 121 + "loc": { 122 + "start": { 123 + "line": 1, 124 + "column": 7 125 + }, 126 + "end": { 127 + "line": 3, 128 + "column": 1 129 + } 130 + }, 131 + "line": 1 132 + }, 133 + "1": { 134 + "name": "isOdd", 135 + "decl": { 136 + "start": { 137 + "line": 5, 138 + "column": 7 139 + }, 140 + "end": { 141 + "line": 7, 142 + "column": 1 143 + } 144 + }, 145 + "loc": { 146 + "start": { 147 + "line": 5, 148 + "column": 7 149 + }, 150 + "end": { 151 + "line": 7, 152 + "column": 1 153 + } 154 + }, 155 + "line": 5 156 + } 157 + }, 158 + "f": { 159 + "0": 1, 160 + "1": 0 161 + } 162 + }, 163 + "<process-cwd>/fixtures/src/math.ts": { 164 + "path": "<process-cwd>/fixtures/src/math.ts", 165 + "all": false, 166 + "statementMap": { 167 + "0": { 168 + "start": { 169 + "line": 1, 170 + "column": 0 171 + }, 172 + "end": { 173 + "line": 1, 174 + "column": 43 175 + } 176 + }, 177 + "1": { 178 + "start": { 179 + "line": 2, 180 + "column": 0 181 + }, 182 + "end": { 183 + "line": 2, 184 + "column": 14 185 + } 186 + }, 187 + "2": { 188 + "start": { 189 + "line": 3, 190 + "column": 0 191 + }, 192 + "end": { 193 + "line": 3, 194 + "column": 1 195 + } 196 + }, 197 + "4": { 198 + "start": { 199 + "line": 5, 200 + "column": 0 201 + }, 202 + "end": { 203 + "line": 5, 204 + "column": 48 205 + } 206 + }, 207 + "5": { 208 + "start": { 209 + "line": 6, 210 + "column": 0 211 + }, 212 + "end": { 213 + "line": 6, 214 + "column": 14 215 + } 216 + }, 217 + "6": { 218 + "start": { 219 + "line": 7, 220 + "column": 0 221 + }, 222 + "end": { 223 + "line": 7, 224 + "column": 1 225 + } 226 + }, 227 + "8": { 228 + "start": { 229 + "line": 9, 230 + "column": 0 231 + }, 232 + "end": { 233 + "line": 9, 234 + "column": 48 235 + } 236 + }, 237 + "9": { 238 + "start": { 239 + "line": 10, 240 + "column": 0 241 + }, 242 + "end": { 243 + "line": 10, 244 + "column": 14 245 + } 246 + }, 247 + "10": { 248 + "start": { 249 + "line": 11, 250 + "column": 0 251 + }, 252 + "end": { 253 + "line": 11, 254 + "column": 1 255 + } 256 + }, 257 + "12": { 258 + "start": { 259 + "line": 13, 260 + "column": 0 261 + }, 262 + "end": { 263 + "line": 13, 264 + "column": 48 265 + } 266 + }, 267 + "13": { 268 + "start": { 269 + "line": 14, 270 + "column": 0 271 + }, 272 + "end": { 273 + "line": 14, 274 + "column": 14 275 + } 276 + }, 277 + "14": { 278 + "start": { 279 + "line": 15, 280 + "column": 0 281 + }, 282 + "end": { 283 + "line": 15, 284 + "column": 1 285 + } 286 + } 287 + }, 288 + "s": { 289 + "0": 1, 290 + "1": 1, 291 + "2": 1, 292 + "4": 1, 293 + "5": 0, 294 + "6": 0, 295 + "8": 1, 296 + "9": 0, 297 + "10": 0, 298 + "12": 1, 299 + "13": 0, 300 + "14": 0 301 + }, 302 + "branchMap": { 303 + "0": { 304 + "type": "branch", 305 + "line": 1, 306 + "loc": { 307 + "start": { 308 + "line": 1, 309 + "column": 7 310 + }, 311 + "end": { 312 + "line": 3, 313 + "column": 1 314 + } 315 + }, 316 + "locations": [ 317 + { 318 + "start": { 319 + "line": 1, 320 + "column": 7 321 + }, 322 + "end": { 323 + "line": 3, 324 + "column": 1 325 + } 326 + } 327 + ] 328 + } 329 + }, 330 + "b": { 331 + "0": [ 332 + 1 333 + ] 334 + }, 335 + "fnMap": { 336 + "0": { 337 + "name": "sum", 338 + "decl": { 339 + "start": { 340 + "line": 1, 341 + "column": 7 342 + }, 343 + "end": { 344 + "line": 3, 345 + "column": 1 346 + } 347 + }, 348 + "loc": { 349 + "start": { 350 + "line": 1, 351 + "column": 7 352 + }, 353 + "end": { 354 + "line": 3, 355 + "column": 1 356 + } 357 + }, 358 + "line": 1 359 + }, 360 + "1": { 361 + "name": "subtract", 362 + "decl": { 363 + "start": { 364 + "line": 5, 365 + "column": 7 366 + }, 367 + "end": { 368 + "line": 7, 369 + "column": 1 370 + } 371 + }, 372 + "loc": { 373 + "start": { 374 + "line": 5, 375 + "column": 7 376 + }, 377 + "end": { 378 + "line": 7, 379 + "column": 1 380 + } 381 + }, 382 + "line": 5 383 + }, 384 + "2": { 385 + "name": "multiply", 386 + "decl": { 387 + "start": { 388 + "line": 9, 389 + "column": 7 390 + }, 391 + "end": { 392 + "line": 11, 393 + "column": 1 394 + } 395 + }, 396 + "loc": { 397 + "start": { 398 + "line": 9, 399 + "column": 7 400 + }, 401 + "end": { 402 + "line": 11, 403 + "column": 1 404 + } 405 + }, 406 + "line": 9 407 + }, 408 + "3": { 409 + "name": "remainder", 410 + "decl": { 411 + "start": { 412 + "line": 13, 413 + "column": 7 414 + }, 415 + "end": { 416 + "line": 15, 417 + "column": 1 418 + } 419 + }, 420 + "loc": { 421 + "start": { 422 + "line": 13, 423 + "column": 7 424 + }, 425 + "end": { 426 + "line": 15, 427 + "column": 1 428 + } 429 + }, 430 + "line": 13 431 + } 432 + }, 433 + "f": { 434 + "0": 1, 435 + "1": 0, 436 + "2": 0, 437 + "3": 0 438 + } 439 + }, 440 + "<process-cwd>/fixtures/src/untested-file.ts": { 441 + "path": "<process-cwd>/fixtures/src/untested-file.ts", 442 + "all": true, 443 + "statementMap": { 444 + "7": { 445 + "start": { 446 + "line": 8, 447 + "column": 0 448 + }, 449 + "end": { 450 + "line": 8, 451 + "column": 40 452 + } 453 + }, 454 + "8": { 455 + "start": { 456 + "line": 9, 457 + "column": 0 458 + }, 459 + "end": { 460 + "line": 9, 461 + "column": 72 462 + } 463 + }, 464 + "9": { 465 + "start": { 466 + "line": 10, 467 + "column": 0 468 + }, 469 + "end": { 470 + "line": 10, 471 + "column": 1 472 + } 473 + }, 474 + "11": { 475 + "start": { 476 + "line": 12, 477 + "column": 0 478 + }, 479 + "end": { 480 + "line": 12, 481 + "column": 36 482 + } 483 + }, 484 + "13": { 485 + "start": { 486 + "line": 14, 487 + "column": 0 488 + }, 489 + "end": { 490 + "line": 14, 491 + "column": 14 492 + } 493 + }, 494 + "14": { 495 + "start": { 496 + "line": 15, 497 + "column": 0 498 + }, 499 + "end": { 500 + "line": 15, 501 + "column": 1 502 + } 503 + }, 504 + "18": { 505 + "start": { 506 + "line": 19, 507 + "column": 0 508 + }, 509 + "end": { 510 + "line": 19, 511 + "column": 41 512 + } 513 + }, 514 + "20": { 515 + "start": { 516 + "line": 21, 517 + "column": 0 518 + }, 519 + "end": { 520 + "line": 21, 521 + "column": 14 522 + } 523 + }, 524 + "21": { 525 + "start": { 526 + "line": 22, 527 + "column": 0 528 + }, 529 + "end": { 530 + "line": 22, 531 + "column": 1 532 + } 533 + }, 534 + "23": { 535 + "start": { 536 + "line": 24, 537 + "column": 0 538 + }, 539 + "end": { 540 + "line": 24, 541 + "column": 65 542 + } 543 + }, 544 + "32": { 545 + "start": { 546 + "line": 33, 547 + "column": 0 548 + }, 549 + "end": { 550 + "line": 33, 551 + "column": 25 552 + } 553 + }, 554 + "34": { 555 + "start": { 556 + "line": 35, 557 + "column": 0 558 + }, 559 + "end": { 560 + "line": 35, 561 + "column": 25 562 + } 563 + }, 564 + "35": { 565 + "start": { 566 + "line": 36, 567 + "column": 0 568 + }, 569 + "end": { 570 + "line": 36, 571 + "column": 3 572 + } 573 + }, 574 + "45": { 575 + "start": { 576 + "line": 46, 577 + "column": 0 578 + }, 579 + "end": { 580 + "line": 46, 581 + "column": 41 582 + } 583 + }, 584 + "46": { 585 + "start": { 586 + "line": 47, 587 + "column": 0 588 + }, 589 + "end": { 590 + "line": 47, 591 + "column": 1 592 + } 593 + } 594 + }, 595 + "s": { 596 + "7": 0, 597 + "8": 0, 598 + "9": 0, 599 + "11": 0, 600 + "13": 0, 601 + "14": 0, 602 + "18": 0, 603 + "20": 0, 604 + "21": 0, 605 + "23": 0, 606 + "32": 0, 607 + "34": 0, 608 + "35": 0, 609 + "45": 0, 610 + "46": 0 611 + }, 612 + "branchMap": { 613 + "0": { 614 + "type": "branch", 615 + "line": 1, 616 + "loc": { 617 + "start": { 618 + "line": 1, 619 + "column": 984 620 + }, 621 + "end": { 622 + "line": 47, 623 + "column": 1 624 + } 625 + }, 626 + "locations": [ 627 + { 628 + "start": { 629 + "line": 1, 630 + "column": 984 631 + }, 632 + "end": { 633 + "line": 47, 634 + "column": 1 635 + } 636 + } 637 + ] 638 + } 639 + }, 640 + "b": { 641 + "0": [ 642 + 1 643 + ] 644 + }, 645 + "fnMap": { 646 + "0": { 647 + "name": "(empty-report)", 648 + "decl": { 649 + "start": { 650 + "line": 1, 651 + "column": 984 652 + }, 653 + "end": { 654 + "line": 47, 655 + "column": 1 656 + } 657 + }, 658 + "loc": { 659 + "start": { 660 + "line": 1, 661 + "column": 984 662 + }, 663 + "end": { 664 + "line": 47, 665 + "column": 1 666 + } 667 + }, 668 + "line": 1 669 + } 670 + }, 671 + "f": { 672 + "0": 1 673 + } 674 + } 675 + }
-6
test/coverage-test/test/__snapshots__/vue.test.ts.snap
··· 1 - // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html 2 - 3 - exports[`vue 3 coverage 1`] = ` 4 - "<div>4 x 2 = 8</div> 5 - <button> x1 </button>" 6 - `;
+5
test/coverage-test/fixtures/src/.should-be-excluded-from-coverage/excluded-from-coverage.ts
··· 1 + // This file should be excluded from coverage report 2 + 3 + export function uncoveredFile() { 4 + return 0 5 + }
+22
test/coverage-test/fixtures/src/Vue/Defined.vue
··· 1 + <script setup lang="ts"> 2 + const defined = 'hello' 3 + 4 + /* eslint-disable no-console */ 5 + if (defined) { 6 + console.log('Covered condition') 7 + } 8 + else { 9 + console.log('Uncovered condition') 10 + } 11 + </script> 12 + 13 + <template> 14 + {{ defined }} 15 + </template> 16 + 17 + <!-- Style block triggers a specific condition where sourcemaps used to break randomly --> 18 + <style lang="css" scoped> 19 + body { 20 + background-color: #FFF; 21 + } 22 + </style>
+17
test/coverage-test/fixtures/src/Vue/Hello.vue
··· 1 + <script setup lang="ts"> 2 + import { computed, ref } from 'vue' 3 + 4 + const props = defineProps<{ count: number }>() 5 + 6 + const times = ref(2) 7 + const result = computed(() => props.count * times.value) 8 + 9 + defineExpose(props) 10 + </script> 11 + 12 + <template> 13 + <div>{{ count }} x {{ times }} = {{ result }}</div> 14 + <button @click="times += 1"> 15 + x1 16 + </button> 17 + </template>
+8
test/coverage-test/fixtures/src/Vue/vue.shim.d.ts
··· 1 + declare const MY_CONSTANT: string 2 + 3 + declare module '*.vue' { 4 + import type { DefineComponent } from 'vue' 5 + 6 + const component: DefineComponent<{}, {}, any> 7 + export default component 8 + }
+21
test/coverage-test/fixtures/src/pre-transpiled/original.ts
··· 1 + export const hello = (arg?: unknown) => { 2 + if (arg) { 3 + // Uncovered 4 + noop(); 5 + } 6 + 7 + // Covered 8 + noop(); 9 + 10 + if (arg === 3) { 11 + // Uncovered 12 + noop(); 13 + } 14 + 15 + if (arg === undefined) { 16 + // Covered 17 + noop(); 18 + } 19 + }; 20 + 21 + function noop() {}
+1
test/coverage-test/fixtures/src/pre-transpiled/transpiled.d.ts
··· 1 + export * from './original'
+18
test/coverage-test/fixtures/src/pre-transpiled/transpiled.js
··· 1 + export var hello = function (arg) { 2 + if (arg) { 3 + // Uncovered 4 + noop(); 5 + } 6 + // Covered 7 + noop(); 8 + if (arg === 3) { 9 + // Uncovered 10 + noop(); 11 + } 12 + if (arg === undefined) { 13 + // Covered 14 + noop(); 15 + } 16 + }; 17 + function noop() { } 18 + //# sourceMappingURL=transpiled.js.map
+13
test/coverage-test/fixtures/src/pre-transpiled/transpiled.js.map
··· 1 + { 2 + "version": 3, 3 + "file": "transpiled.js", 4 + "sourceRoot": "", 5 + "sources": [ 6 + "./original.ts" 7 + ], 8 + "names": [], 9 + "mappings": "AAAA,MAAM,CAAC,IAAM,KAAK,GAAG,UAAC,GAAa;IACjC,IAAI,GAAG,EAAE,CAAC;QACR,YAAY;QACZ,IAAI,EAAE,CAAC;IACT,CAAC;IAED,UAAU;IACV,IAAI,EAAE,CAAC;IAEP,IAAI,GAAG,KAAK,CAAC,EAAE,CAAC;QACd,YAAY;QACZ,IAAI,EAAE,CAAC;IACT,CAAC;IAED,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QACtB,UAAU;QACV,IAAI,EAAE,CAAC;IACT,CAAC;AACH,CAAC,CAAC;AAEF,SAAS,IAAI,KAAI,CAAC", 10 + "sourcesContent": [ 11 + "export const hello = (arg?: unknown) => {\n if (arg) {\n // Uncovered\n noop();\n }\n\n // Covered\n noop();\n\n if (arg === 3) {\n // Uncovered\n noop();\n }\n\n if (arg === undefined) {\n // Covered\n noop();\n }\n};\n\nfunction noop() {}\n" 12 + ] 13 + }
+24
test/coverage-test/fixtures/src/Vue/Counter/Counter.component.ts
··· 1 + import { defineComponent, ref } from 'vue' 2 + 3 + export default defineComponent({ 4 + name: 'Counter', 5 + 6 + setup() { 7 + const count = ref(0) 8 + return { count } 9 + }, 10 + 11 + methods: { 12 + uncoveredMethod() { 13 + return 'This line should not be covered' 14 + }, 15 + 16 + coveredMethod() { 17 + return 'This line should be covered' 18 + }, 19 + 20 + uncoveredMethodUsingImportMeta() { 21 + return `Source maps tend to break when import meta is used: ${import.meta.env.BASE_URL}` 22 + }, 23 + }, 24 + })
+14
test/coverage-test/fixtures/src/Vue/Counter/Counter.vue
··· 1 + <script lang="ts" src="./Counter.component.ts"></script> 2 + 3 + <template> 4 + <button @click="count++"> 5 + {{ count }} 6 + </button> 7 + 8 + <div v-if="count > 10"> 9 + {{ uncoveredMethod() }} 10 + </div> 11 + <div v-else> 12 + {{ coveredMethod() }} 13 + </div> 14 + </template>
+3
test/coverage-test/fixtures/src/Vue/Counter/index.ts
··· 1 + import CounterVue from './Counter.vue' 2 + 3 + export { CounterVue }