[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.

fix(coverage): browser mode + `coverage.all` (#7597)

authored by

Ari Perkkiö and committed by
GitHub
(Mar 17, 2025, 12:52 PM +0100) 422ba66b 10bbbe96

+236 -1961
+2
test/coverage-test/vitest.workspace.custom.ts
··· 67 67 BROWSER_TESTS, 68 68 69 69 // Other non-provider-specific tests that should be run on browser mode as well 70 + '**/all.test.ts', 70 71 '**/isolation.test.ts', 71 72 '**/include-exclude.test.ts', 72 73 '**/allow-external.test.ts', ··· 92 93 BROWSER_TESTS, 93 94 94 95 // Other non-provider-specific tests that should be run on browser mode as well 96 + '**/all.test.ts', 95 97 '**/isolation.test.ts', 96 98 '**/include-exclude.test.ts', 97 99 '**/allow-external.test.ts',
+38 -38
packages/coverage-v8/src/provider.ts
··· 103 103 const coveredFiles = coverageMap.files() 104 104 const untestedCoverage = await this.getUntestedFiles(coveredFiles) 105 105 106 - const converted = await this.convertCoverage(untestedCoverage) 107 - coverageMap.merge(await transformCoverage(converted)) 106 + coverageMap.merge(await transformCoverage(untestedCoverage)) 108 107 } 109 108 110 109 if (this.options.excludeAfterRemap) { ··· 158 157 ) 159 158 } 160 159 161 - private async getUntestedFiles(testedFiles: string[]): Promise<RawCoverage> { 160 + private async getUntestedFiles(testedFiles: string[]): Promise<CoverageMap> { 162 161 const transformResults = normalizeTransformResults( 163 162 this.ctx.vitenode.fetchCache, 164 163 ) ··· 179 178 .map(file => pathToFileURL(file)) 180 179 .filter(file => !testedFiles.includes(file.pathname)) 181 180 182 - let merged: RawCoverage = { result: [] } 183 181 let index = 0 182 + 183 + const coverageMap = this.createCoverageMap() 184 184 185 185 for (const chunk of this.toSlices(uncoveredFiles, this.options.processingConcurrency)) { 186 186 if (debug.enabled) { ··· 188 188 debug('Uncovered files %d/%d', index, uncoveredFiles.length) 189 189 } 190 190 191 - const coverages = await Promise.all( 192 - chunk.map(async (filename) => { 193 - const { originalSource } = await this.getSources( 194 - filename.href, 195 - transformResults, 196 - transform, 197 - ) 191 + await Promise.all(chunk.map(async (filename) => { 192 + const sources = await this.getSources( 193 + filename.href, 194 + transformResults, 195 + transform, 196 + ) 198 197 199 - const coverage = { 200 - url: filename.href, 201 - scriptId: '0', 202 - // Create a made up function to mark whole file as uncovered. Note that this does not exist in source maps. 203 - functions: [ 198 + const converter = v8ToIstanbul( 199 + filename.href, 200 + 0, 201 + sources, 202 + undefined, 203 + this.options.ignoreEmptyLines, 204 + ) 205 + 206 + await converter.load() 207 + 208 + try { 209 + // Create a made up function to mark whole file as uncovered. Note that this does not exist in source maps. 210 + converter.applyCoverage([{ 211 + ranges: [ 204 212 { 205 - ranges: [ 206 - { 207 - startOffset: 0, 208 - endOffset: originalSource.length, 209 - count: 0, 210 - }, 211 - ], 212 - isBlockCoverage: true, 213 - // This is magical value that indicates an empty report: https://github.com/istanbuljs/v8-to-istanbul/blob/fca5e6a9e6ef38a9cdc3a178d5a6cf9ef82e6cab/lib/v8-to-istanbul.js#LL131C40-L131C40 214 - functionName: '(empty-report)', 213 + startOffset: 0, 214 + endOffset: sources.originalSource.length, 215 + count: 0, 215 216 }, 216 217 ], 217 - } 218 + isBlockCoverage: true, 219 + // This is magical value that indicates an empty report: https://github.com/istanbuljs/v8-to-istanbul/blob/fca5e6a9e6ef38a9cdc3a178d5a6cf9ef82e6cab/lib/v8-to-istanbul.js#LL131C40-L131C40 220 + functionName: '(empty-report)', 221 + }]) 222 + } 223 + catch (error) { 224 + this.ctx.logger.error(`Failed to convert coverage for uncovered ${filename.href}.\n`, error) 225 + } 218 226 219 - return { result: [coverage] } 220 - }), 221 - ) 222 - 223 - merged = mergeProcessCovs([ 224 - merged, 225 - ...coverages.filter( 226 - (cov): cov is NonNullable<typeof cov> => cov != null, 227 - ), 228 - ]) 227 + coverageMap.merge(converter.toIstanbul()) 228 + })) 229 229 } 230 230 231 - return merged 231 + return coverageMap 232 232 } 233 233 234 234 private async getSources<TransformResult extends (FetchResult | Awaited<ReturnType<typeof this.ctx.vitenode.transformRequest>>)>(
+1 -1
packages/vite-node/src/client.ts
··· 535 535 } 536 536 537 537 protected importExternalModule(path: string): Promise<any> { 538 - return import(path) 538 + return import(/* @vite-ignore */ path) 539 539 } 540 540 541 541 /**
+33 -1
test/coverage-test/test/all.test.ts
··· 1 1 import { expect } from 'vitest' 2 - import { readCoverageMap, runVitest, test } from '../utils' 2 + import { isBrowser, readCoverageMap, runVitest, test } from '../utils' 3 3 4 4 test('{ all: true } includes uncovered files', async () => { 5 5 await runVitest({ ··· 76 76 77 77 expect(files).toContain('<process-cwd>/fixtures/src/untested-file.ts') 78 78 expect(files.length).toBeGreaterThanOrEqual(3) 79 + } 80 + }) 81 + 82 + test('transforms uncovered files correctly', async () => { 83 + await runVitest({ 84 + config: 'fixtures/configs/vitest.config.conditional.ts', 85 + include: ['fixtures/test/math.test.ts'], 86 + coverage: { 87 + include: ['fixtures/src/math.ts', 'fixtures/src/conditional/*'], 88 + all: true, 89 + reporter: 'json', 90 + }, 91 + }) 92 + 93 + const coverageMap = await readCoverageMap() 94 + const files = coverageMap.files() 95 + 96 + if (isBrowser()) { 97 + expect(files).toMatchInlineSnapshot(` 98 + [ 99 + "<process-cwd>/fixtures/src/math.ts", 100 + "<process-cwd>/fixtures/src/conditional/browser.ts", 101 + ] 102 + `) 103 + } 104 + else { 105 + expect(files).toMatchInlineSnapshot(` 106 + [ 107 + "<process-cwd>/fixtures/src/math.ts", 108 + "<process-cwd>/fixtures/src/conditional/node.ts", 109 + ] 110 + `) 79 111 } 80 112 })
+51 -3
test/coverage-test/test/results-snapshot.test.ts
··· 1 1 import { expect } from 'vitest' 2 - import { isV8Provider, readCoverageJson, runVitest, test } from '../utils' 2 + import { isV8Provider, readCoverageMap, runVitest, test } from '../utils' 3 3 4 4 test('coverage results matches snapshot', async () => { 5 5 await runVitest({ ··· 14 14 }, 15 15 }) 16 16 17 - const coverageJson = await readCoverageJson() 17 + const coverageMap = await readCoverageMap() 18 + const fileCoverages = coverageMap.files().map(file => coverageMap.fileCoverageFor(file)) 18 19 19 - await expect(JSON.stringify(coverageJson, null, 2)).toMatchFileSnapshot(`__snapshots__/results-${isV8Provider() ? 'v8' : 'istanbul'}.snapshot.json`) 20 + if (isV8Provider()) { 21 + expect(fileCoverages).toMatchInlineSnapshot(` 22 + { 23 + "<process-cwd>/fixtures/src/even.ts": { 24 + "branches": "1/1 (100%)", 25 + "functions": "1/2 (50%)", 26 + "lines": "4/6 (66.66%)", 27 + "statements": "4/6 (66.66%)", 28 + }, 29 + "<process-cwd>/fixtures/src/math.ts": { 30 + "branches": "1/1 (100%)", 31 + "functions": "1/4 (25%)", 32 + "lines": "6/12 (50%)", 33 + "statements": "6/12 (50%)", 34 + }, 35 + "<process-cwd>/fixtures/src/untested-file.ts": { 36 + "branches": "1/1 (100%)", 37 + "functions": "1/1 (100%)", 38 + "lines": "0/15 (0%)", 39 + "statements": "0/15 (0%)", 40 + }, 41 + } 42 + `) 43 + } 44 + else { 45 + expect(fileCoverages).toMatchInlineSnapshot(` 46 + { 47 + "<process-cwd>/fixtures/src/even.ts": { 48 + "branches": "0/0 (100%)", 49 + "functions": "1/2 (50%)", 50 + "lines": "1/2 (50%)", 51 + "statements": "1/2 (50%)", 52 + }, 53 + "<process-cwd>/fixtures/src/math.ts": { 54 + "branches": "0/0 (100%)", 55 + "functions": "1/4 (25%)", 56 + "lines": "1/4 (25%)", 57 + "statements": "1/4 (25%)", 58 + }, 59 + "<process-cwd>/fixtures/src/untested-file.ts": { 60 + "branches": "0/4 (0%)", 61 + "functions": "0/4 (0%)", 62 + "lines": "0/8 (0%)", 63 + "statements": "0/8 (0%)", 64 + }, 65 + } 66 + `) 67 + } 20 68 })
+73 -13
test/coverage-test/test/workspace.multi-transform.test.ts
··· 26 26 ] 27 27 `) 28 28 29 - const covered1 = coverageMap.fileCoverageFor('<process-cwd>/fixtures/src/covered.custom-1') 30 - const uncovered1 = coverageMap.fileCoverageFor('<process-cwd>/fixtures/src/uncovered.custom-1') 31 - const covered2 = coverageMap.fileCoverageFor('<process-cwd>/fixtures/workspaces/custom-2/src/covered.custom-2') 32 - const uncovered2 = coverageMap.fileCoverageFor('<process-cwd>/fixtures/workspaces/custom-2/src/uncovered.custom-2') 29 + const fileCoverages = coverageMap.files().map(file => coverageMap.fileCoverageFor(file)) 33 30 34 - // Coverage maps indicate whether source maps are correct. Check html-report if these change 35 - await expect(JSON.stringify(covered1, null, 2)).toMatchFileSnapshot(snapshotName('covered-1')) 36 - await expect(JSON.stringify(uncovered1, null, 2)).toMatchFileSnapshot(snapshotName('uncovered-1')) 37 - await expect(JSON.stringify(covered2, null, 2)).toMatchFileSnapshot(snapshotName('covered-2')) 38 - await expect(JSON.stringify(uncovered2, null, 2)).toMatchFileSnapshot(snapshotName('uncovered-2')) 31 + if (isV8Provider()) { 32 + expect(fileCoverages).toMatchInlineSnapshot(` 33 + { 34 + "<process-cwd>/fixtures/src/covered.custom-1": { 35 + "branches": "1/1 (100%)", 36 + "functions": "1/2 (50%)", 37 + "lines": "2/3 (66.66%)", 38 + "statements": "2/3 (66.66%)", 39 + }, 40 + "<process-cwd>/fixtures/src/math.ts": { 41 + "branches": "1/1 (100%)", 42 + "functions": "1/4 (25%)", 43 + "lines": "6/12 (50%)", 44 + "statements": "6/12 (50%)", 45 + }, 46 + "<process-cwd>/fixtures/src/uncovered.custom-1": { 47 + "branches": "0/1 (0%)", 48 + "functions": "0/1 (0%)", 49 + "lines": "0/2 (0%)", 50 + "statements": "0/2 (0%)", 51 + }, 52 + "<process-cwd>/fixtures/workspaces/custom-2/src/covered.custom-2": { 53 + "branches": "1/1 (100%)", 54 + "functions": "1/2 (50%)", 55 + "lines": "2/3 (66.66%)", 56 + "statements": "2/3 (66.66%)", 57 + }, 58 + "<process-cwd>/fixtures/workspaces/custom-2/src/uncovered.custom-2": { 59 + "branches": "0/1 (0%)", 60 + "functions": "0/1 (0%)", 61 + "lines": "0/2 (0%)", 62 + "statements": "0/2 (0%)", 63 + }, 64 + } 65 + `) 66 + } 67 + else { 68 + expect(fileCoverages).toMatchInlineSnapshot(` 69 + { 70 + "<process-cwd>/fixtures/src/covered.custom-1": { 71 + "branches": "0/0 (100%)", 72 + "functions": "1/2 (50%)", 73 + "lines": "1/2 (50%)", 74 + "statements": "1/2 (50%)", 75 + }, 76 + "<process-cwd>/fixtures/src/math.ts": { 77 + "branches": "0/0 (100%)", 78 + "functions": "1/4 (25%)", 79 + "lines": "1/4 (25%)", 80 + "statements": "1/4 (25%)", 81 + }, 82 + "<process-cwd>/fixtures/src/uncovered.custom-1": { 83 + "branches": "0/0 (100%)", 84 + "functions": "0/1 (0%)", 85 + "lines": "0/1 (0%)", 86 + "statements": "0/1 (0%)", 87 + }, 88 + "<process-cwd>/fixtures/workspaces/custom-2/src/covered.custom-2": { 89 + "branches": "0/0 (100%)", 90 + "functions": "1/2 (50%)", 91 + "lines": "1/2 (50%)", 92 + "statements": "1/2 (50%)", 93 + }, 94 + "<process-cwd>/fixtures/workspaces/custom-2/src/uncovered.custom-2": { 95 + "branches": "0/0 (100%)", 96 + "functions": "0/1 (0%)", 97 + "lines": "0/1 (0%)", 98 + "statements": "0/1 (0%)", 99 + }, 100 + } 101 + `) 102 + } 39 103 }) 40 - 41 - function snapshotName(label: string) { 42 - return `__snapshots__/custom-file-${label}-${isV8Provider() ? 'v8' : 'istanbul'}.snapshot.json` 43 - }
+13 -3
packages/vitest/src/node/coverage.ts
··· 552 552 const servers = [ 553 553 ...ctx.projects.map(project => ({ 554 554 root: project.config.root, 555 + isBrowserEnabled: project.isBrowserEnabled(), 555 556 vitenode: project.vitenode, 556 557 })), 557 558 // Check core last as it will match all files anyway 558 - { root: ctx.config.root, vitenode: ctx.vitenode }, 559 + { root: ctx.config.root, vitenode: ctx.vitenode, isBrowserEnabled: ctx.getRootProject().isBrowserEnabled() }, 559 560 ] 560 561 561 562 return async function transformFile(filename: string): Promise<TransformResult | null | undefined> { 562 563 let lastError 563 564 564 - for (const { root, vitenode } of servers) { 565 - if (!filename.startsWith(root)) { 565 + for (const { root, vitenode, isBrowserEnabled } of servers) { 566 + // On Windows root doesn't start with "/" while filenames do 567 + if (!filename.startsWith(root) && !filename.startsWith(`/${root}`)) { 566 568 continue 569 + } 570 + 571 + if (isBrowserEnabled) { 572 + const result = await vitenode.transformRequest(filename, undefined, 'web').catch(() => null) 573 + 574 + if (result) { 575 + return result 576 + } 567 577 } 568 578 569 579 try {
+19
test/coverage-test/fixtures/configs/vitest.config.conditional.ts
··· 1 + import { join, resolve } from 'node:path' 2 + import { defineConfig } from 'vitest/config' 3 + 4 + export default defineConfig({ 5 + resolve: { 6 + alias: [ 7 + { 8 + find: /fixtures\/src\/conditional/, 9 + replacement: "$1", 10 + customResolver(_, __, options) { 11 + if ('ssr' in options && options.ssr) { 12 + return { id: resolve('fixtures/src/conditional/node.ts') } 13 + } 14 + return { id: resolve('fixtures/src/conditional/browser.ts') } 15 + }, 16 + }, 17 + ], 18 + }, 19 + })
-83
test/coverage-test/test/__snapshots__/custom-file-covered-1-istanbul.snapshot.json
··· 1 - { 2 - "path": "<process-cwd>/fixtures/src/covered.custom-1", 3 - "statementMap": { 4 - "0": { 5 - "start": { 6 - "line": 1, 7 - "column": 0 8 - }, 9 - "end": { 10 - "line": 1, 11 - "column": null 12 - } 13 - }, 14 - "1": { 15 - "start": { 16 - "line": 3, 17 - "column": 0 18 - }, 19 - "end": { 20 - "line": 3, 21 - "column": null 22 - } 23 - } 24 - }, 25 - "fnMap": { 26 - "0": { 27 - "name": "covered", 28 - "decl": { 29 - "start": { 30 - "line": 1, 31 - "column": 0 32 - }, 33 - "end": { 34 - "line": 1, 35 - "column": null 36 - } 37 - }, 38 - "loc": { 39 - "start": { 40 - "line": 1, 41 - "column": 0 42 - }, 43 - "end": { 44 - "line": 1, 45 - "column": null 46 - } 47 - } 48 - }, 49 - "1": { 50 - "name": "uncovered", 51 - "decl": { 52 - "start": { 53 - "line": 3, 54 - "column": 0 55 - }, 56 - "end": { 57 - "line": 3, 58 - "column": null 59 - } 60 - }, 61 - "loc": { 62 - "start": { 63 - "line": 3, 64 - "column": 0 65 - }, 66 - "end": { 67 - "line": 3, 68 - "column": null 69 - } 70 - } 71 - } 72 - }, 73 - "branchMap": {}, 74 - "s": { 75 - "0": 1, 76 - "1": 0 77 - }, 78 - "f": { 79 - "0": 1, 80 - "1": 0 81 - }, 82 - "b": {} 83 - }
-128
test/coverage-test/test/__snapshots__/custom-file-covered-1-v8.snapshot.json
··· 1 - { 2 - "path": "<process-cwd>/fixtures/src/covered.custom-1", 3 - "all": false, 4 - "statementMap": { 5 - "0": { 6 - "start": { 7 - "line": 1, 8 - "column": 0 9 - }, 10 - "end": { 11 - "line": 1, 12 - "column": 18 13 - } 14 - }, 15 - "2": { 16 - "start": { 17 - "line": 3, 18 - "column": 0 19 - }, 20 - "end": { 21 - "line": 3, 22 - "column": 20 23 - } 24 - }, 25 - "4": { 26 - "start": { 27 - "line": 5, 28 - "column": 0 29 - }, 30 - "end": { 31 - "line": 5, 32 - "column": 24 33 - } 34 - } 35 - }, 36 - "s": { 37 - "0": 1, 38 - "2": 0, 39 - "4": 1 40 - }, 41 - "branchMap": { 42 - "0": { 43 - "type": "branch", 44 - "line": 1, 45 - "loc": { 46 - "start": { 47 - "line": 1, 48 - "column": 0 49 - }, 50 - "end": { 51 - "line": 1, 52 - "column": 18 53 - } 54 - }, 55 - "locations": [ 56 - { 57 - "start": { 58 - "line": 1, 59 - "column": 0 60 - }, 61 - "end": { 62 - "line": 1, 63 - "column": 18 64 - } 65 - } 66 - ] 67 - } 68 - }, 69 - "b": { 70 - "0": [ 71 - 1 72 - ] 73 - }, 74 - "fnMap": { 75 - "0": { 76 - "name": "covered", 77 - "decl": { 78 - "start": { 79 - "line": 1, 80 - "column": 0 81 - }, 82 - "end": { 83 - "line": 1, 84 - "column": 18 85 - } 86 - }, 87 - "loc": { 88 - "start": { 89 - "line": 1, 90 - "column": 0 91 - }, 92 - "end": { 93 - "line": 1, 94 - "column": 18 95 - } 96 - }, 97 - "line": 1 98 - }, 99 - "1": { 100 - "name": "uncovered", 101 - "decl": { 102 - "start": { 103 - "line": 3, 104 - "column": 0 105 - }, 106 - "end": { 107 - "line": 3, 108 - "column": 20 109 - } 110 - }, 111 - "loc": { 112 - "start": { 113 - "line": 3, 114 - "column": 0 115 - }, 116 - "end": { 117 - "line": 3, 118 - "column": 20 119 - } 120 - }, 121 - "line": 3 122 - } 123 - }, 124 - "f": { 125 - "0": 1, 126 - "1": 0 127 - } 128 - }
-83
test/coverage-test/test/__snapshots__/custom-file-covered-2-istanbul.snapshot.json
··· 1 - { 2 - "path": "<process-cwd>/fixtures/workspaces/custom-2/src/covered.custom-2", 3 - "statementMap": { 4 - "0": { 5 - "start": { 6 - "line": 1, 7 - "column": 0 8 - }, 9 - "end": { 10 - "line": 1, 11 - "column": null 12 - } 13 - }, 14 - "1": { 15 - "start": { 16 - "line": 3, 17 - "column": 0 18 - }, 19 - "end": { 20 - "line": 3, 21 - "column": null 22 - } 23 - } 24 - }, 25 - "fnMap": { 26 - "0": { 27 - "name": "covered", 28 - "decl": { 29 - "start": { 30 - "line": 1, 31 - "column": 0 32 - }, 33 - "end": { 34 - "line": 1, 35 - "column": null 36 - } 37 - }, 38 - "loc": { 39 - "start": { 40 - "line": 1, 41 - "column": 0 42 - }, 43 - "end": { 44 - "line": 1, 45 - "column": null 46 - } 47 - } 48 - }, 49 - "1": { 50 - "name": "uncovered", 51 - "decl": { 52 - "start": { 53 - "line": 3, 54 - "column": 0 55 - }, 56 - "end": { 57 - "line": 3, 58 - "column": null 59 - } 60 - }, 61 - "loc": { 62 - "start": { 63 - "line": 3, 64 - "column": 0 65 - }, 66 - "end": { 67 - "line": 3, 68 - "column": null 69 - } 70 - } 71 - } 72 - }, 73 - "branchMap": {}, 74 - "s": { 75 - "0": 1, 76 - "1": 0 77 - }, 78 - "f": { 79 - "0": 1, 80 - "1": 0 81 - }, 82 - "b": {} 83 - }
-128
test/coverage-test/test/__snapshots__/custom-file-covered-2-v8.snapshot.json
··· 1 - { 2 - "path": "<process-cwd>/fixtures/workspaces/custom-2/src/covered.custom-2", 3 - "all": false, 4 - "statementMap": { 5 - "0": { 6 - "start": { 7 - "line": 1, 8 - "column": 0 9 - }, 10 - "end": { 11 - "line": 1, 12 - "column": 18 13 - } 14 - }, 15 - "2": { 16 - "start": { 17 - "line": 3, 18 - "column": 0 19 - }, 20 - "end": { 21 - "line": 3, 22 - "column": 20 23 - } 24 - }, 25 - "4": { 26 - "start": { 27 - "line": 5, 28 - "column": 0 29 - }, 30 - "end": { 31 - "line": 5, 32 - "column": 24 33 - } 34 - } 35 - }, 36 - "s": { 37 - "0": 1, 38 - "2": 0, 39 - "4": 1 40 - }, 41 - "branchMap": { 42 - "0": { 43 - "type": "branch", 44 - "line": 1, 45 - "loc": { 46 - "start": { 47 - "line": 1, 48 - "column": 0 49 - }, 50 - "end": { 51 - "line": 1, 52 - "column": 18 53 - } 54 - }, 55 - "locations": [ 56 - { 57 - "start": { 58 - "line": 1, 59 - "column": 0 60 - }, 61 - "end": { 62 - "line": 1, 63 - "column": 18 64 - } 65 - } 66 - ] 67 - } 68 - }, 69 - "b": { 70 - "0": [ 71 - 1 72 - ] 73 - }, 74 - "fnMap": { 75 - "0": { 76 - "name": "covered", 77 - "decl": { 78 - "start": { 79 - "line": 1, 80 - "column": 0 81 - }, 82 - "end": { 83 - "line": 1, 84 - "column": 18 85 - } 86 - }, 87 - "loc": { 88 - "start": { 89 - "line": 1, 90 - "column": 0 91 - }, 92 - "end": { 93 - "line": 1, 94 - "column": 18 95 - } 96 - }, 97 - "line": 1 98 - }, 99 - "1": { 100 - "name": "uncovered", 101 - "decl": { 102 - "start": { 103 - "line": 3, 104 - "column": 0 105 - }, 106 - "end": { 107 - "line": 3, 108 - "column": 20 109 - } 110 - }, 111 - "loc": { 112 - "start": { 113 - "line": 3, 114 - "column": 0 115 - }, 116 - "end": { 117 - "line": 3, 118 - "column": 20 119 - } 120 - }, 121 - "line": 3 122 - } 123 - }, 124 - "f": { 125 - "0": 1, 126 - "1": 0 127 - } 128 - }
-48
test/coverage-test/test/__snapshots__/custom-file-uncovered-1-istanbul.snapshot.json
··· 1 - { 2 - "path": "<process-cwd>/fixtures/src/uncovered.custom-1", 3 - "statementMap": { 4 - "0": { 5 - "start": { 6 - "line": 1, 7 - "column": 0 8 - }, 9 - "end": { 10 - "line": 1, 11 - "column": null 12 - } 13 - } 14 - }, 15 - "fnMap": { 16 - "0": { 17 - "name": "uncovered", 18 - "decl": { 19 - "start": { 20 - "line": 1, 21 - "column": 0 22 - }, 23 - "end": { 24 - "line": 1, 25 - "column": null 26 - } 27 - }, 28 - "loc": { 29 - "start": { 30 - "line": 1, 31 - "column": 0 32 - }, 33 - "end": { 34 - "line": 1, 35 - "column": null 36 - } 37 - } 38 - } 39 - }, 40 - "branchMap": {}, 41 - "s": { 42 - "0": 0 43 - }, 44 - "f": { 45 - "0": 0 46 - }, 47 - "b": {} 48 - }
-103
test/coverage-test/test/__snapshots__/custom-file-uncovered-1-v8.snapshot.json
··· 1 - { 2 - "path": "<process-cwd>/fixtures/src/uncovered.custom-1", 3 - "all": true, 4 - "statementMap": { 5 - "0": { 6 - "start": { 7 - "line": 1, 8 - "column": 0 9 - }, 10 - "end": { 11 - "line": 1, 12 - "column": 20 13 - } 14 - }, 15 - "1": { 16 - "start": { 17 - "line": 2, 18 - "column": 0 19 - }, 20 - "end": { 21 - "line": 2, 22 - "column": 0 23 - } 24 - }, 25 - "2": { 26 - "start": { 27 - "line": 3, 28 - "column": 0 29 - }, 30 - "end": { 31 - "line": 3, 32 - "column": 26 33 - } 34 - } 35 - }, 36 - "s": { 37 - "0": 0, 38 - "1": 0, 39 - "2": 0 40 - }, 41 - "branchMap": { 42 - "0": { 43 - "type": "branch", 44 - "line": 1, 45 - "loc": { 46 - "start": { 47 - "line": 1, 48 - "column": 0 49 - }, 50 - "end": { 51 - "line": 3, 52 - "column": 26 53 - } 54 - }, 55 - "locations": [ 56 - { 57 - "start": { 58 - "line": 1, 59 - "column": 0 60 - }, 61 - "end": { 62 - "line": 3, 63 - "column": 26 64 - } 65 - } 66 - ] 67 - } 68 - }, 69 - "b": { 70 - "0": [ 71 - 0 72 - ] 73 - }, 74 - "fnMap": { 75 - "0": { 76 - "name": "(empty-report)", 77 - "decl": { 78 - "start": { 79 - "line": 1, 80 - "column": 0 81 - }, 82 - "end": { 83 - "line": 3, 84 - "column": 26 85 - } 86 - }, 87 - "loc": { 88 - "start": { 89 - "line": 1, 90 - "column": 0 91 - }, 92 - "end": { 93 - "line": 3, 94 - "column": 26 95 - } 96 - }, 97 - "line": 1 98 - } 99 - }, 100 - "f": { 101 - "0": 0 102 - } 103 - }
-48
test/coverage-test/test/__snapshots__/custom-file-uncovered-2-istanbul.snapshot.json
··· 1 - { 2 - "path": "<process-cwd>/fixtures/workspaces/custom-2/src/uncovered.custom-2", 3 - "statementMap": { 4 - "0": { 5 - "start": { 6 - "line": 1, 7 - "column": 0 8 - }, 9 - "end": { 10 - "line": 1, 11 - "column": null 12 - } 13 - } 14 - }, 15 - "fnMap": { 16 - "0": { 17 - "name": "uncovered", 18 - "decl": { 19 - "start": { 20 - "line": 1, 21 - "column": 0 22 - }, 23 - "end": { 24 - "line": 1, 25 - "column": null 26 - } 27 - }, 28 - "loc": { 29 - "start": { 30 - "line": 1, 31 - "column": 0 32 - }, 33 - "end": { 34 - "line": 1, 35 - "column": null 36 - } 37 - } 38 - } 39 - }, 40 - "branchMap": {}, 41 - "s": { 42 - "0": 0 43 - }, 44 - "f": { 45 - "0": 0 46 - }, 47 - "b": {} 48 - }
-103
test/coverage-test/test/__snapshots__/custom-file-uncovered-2-v8.snapshot.json
··· 1 - { 2 - "path": "<process-cwd>/fixtures/workspaces/custom-2/src/uncovered.custom-2", 3 - "all": true, 4 - "statementMap": { 5 - "0": { 6 - "start": { 7 - "line": 1, 8 - "column": 0 9 - }, 10 - "end": { 11 - "line": 1, 12 - "column": 20 13 - } 14 - }, 15 - "1": { 16 - "start": { 17 - "line": 2, 18 - "column": 0 19 - }, 20 - "end": { 21 - "line": 2, 22 - "column": 0 23 - } 24 - }, 25 - "2": { 26 - "start": { 27 - "line": 3, 28 - "column": 0 29 - }, 30 - "end": { 31 - "line": 3, 32 - "column": 26 33 - } 34 - } 35 - }, 36 - "s": { 37 - "0": 0, 38 - "1": 0, 39 - "2": 0 40 - }, 41 - "branchMap": { 42 - "0": { 43 - "type": "branch", 44 - "line": 1, 45 - "loc": { 46 - "start": { 47 - "line": 1, 48 - "column": 0 49 - }, 50 - "end": { 51 - "line": 3, 52 - "column": 26 53 - } 54 - }, 55 - "locations": [ 56 - { 57 - "start": { 58 - "line": 1, 59 - "column": 0 60 - }, 61 - "end": { 62 - "line": 3, 63 - "column": 26 64 - } 65 - } 66 - ] 67 - } 68 - }, 69 - "b": { 70 - "0": [ 71 - 0 72 - ] 73 - }, 74 - "fnMap": { 75 - "0": { 76 - "name": "(empty-report)", 77 - "decl": { 78 - "start": { 79 - "line": 1, 80 - "column": 0 81 - }, 82 - "end": { 83 - "line": 3, 84 - "column": 26 85 - } 86 - }, 87 - "loc": { 88 - "start": { 89 - "line": 1, 90 - "column": 0 91 - }, 92 - "end": { 93 - "line": 3, 94 - "column": 26 95 - } 96 - }, 97 - "line": 1 98 - } 99 - }, 100 - "f": { 101 - "0": 0 102 - } 103 - }
-503
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 - "end": {} 443 - } 444 - ] 445 - }, 446 - "1": { 447 - "loc": { 448 - "start": { 449 - "line": 39, 450 - "column": 2 451 - }, 452 - "end": { 453 - "line": 42, 454 - "column": null 455 - } 456 - }, 457 - "type": "if", 458 - "locations": [ 459 - { 460 - "start": { 461 - "line": 39, 462 - "column": 2 463 - }, 464 - "end": { 465 - "line": 42, 466 - "column": null 467 - } 468 - }, 469 - { 470 - "start": {}, 471 - "end": {} 472 - } 473 - ] 474 - } 475 - }, 476 - "s": { 477 - "0": 0, 478 - "1": 0, 479 - "2": 0, 480 - "3": 0, 481 - "4": 0, 482 - "5": 0, 483 - "6": 0, 484 - "7": 0 485 - }, 486 - "f": { 487 - "0": 0, 488 - "1": 0, 489 - "2": 0, 490 - "3": 0 491 - }, 492 - "b": { 493 - "0": [ 494 - 0, 495 - 0 496 - ], 497 - "1": [ 498 - 0, 499 - 0 500 - ] 501 - } 502 - } 503 - }
-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 - }
+3
test/coverage-test/fixtures/src/conditional/browser.ts
··· 1 + export function browser() { 2 + return "This is for browsers only" 3 + }
+3
test/coverage-test/fixtures/src/conditional/node.ts
··· 1 + export function node() { 2 + return "This is for node only" 3 + }