[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): apply patch from istanbuljs/istanbuljs#837 (#9413)

Co-authored-by: sapphi-red <green@sapphi.red>

authored by

Ari Perkkiö
sapphi-red
and committed by
GitHub
(Jan 9, 2026, 1:08 PM +0900) e05cedbf f1ea6bee

+56 -6
+1 -1
packages/coverage-istanbul/package.json
··· 50 50 "istanbul-lib-coverage": "catalog:", 51 51 "istanbul-lib-instrument": "^6.0.3", 52 52 "istanbul-lib-report": "catalog:", 53 - "istanbul-lib-source-maps": "catalog:", 54 53 "istanbul-reports": "catalog:", 55 54 "magicast": "catalog:", 56 55 "obug": "catalog:", ··· 62 61 "@types/istanbul-lib-report": "catalog:", 63 62 "@types/istanbul-lib-source-maps": "catalog:", 64 63 "@types/istanbul-reports": "catalog:", 64 + "istanbul-lib-source-maps": "catalog:", 65 65 "pathe": "catalog:", 66 66 "vitest": "workspace:*" 67 67 }
+4 -1
packages/coverage-istanbul/rollup.config.js
··· 27 27 ...dtsUtils.isolatedDecl(), 28 28 nodeResolve(), 29 29 json(), 30 - commonjs(), 30 + commonjs({ 31 + // "istanbul-lib-source-maps > @jridgewell/trace-mapping" is not CJS 32 + esmExternals: ['@jridgewell/trace-mapping'], 33 + }), 31 34 oxc({ 32 35 transform: { target: 'node18' }, 33 36 }),
+43
patches/istanbul-lib-source-maps.patch
··· 1 + diff --git a/CHANGELOG.md b/CHANGELOG.md 2 + deleted file mode 100644 3 + index dad8c06aac26cb8cfced31da5f35ac8e95915f15..0000000000000000000000000000000000000000 4 + diff --git a/lib/get-mapping.js b/lib/get-mapping.js 5 + index 187a02ed65104d8e3a058d6bfe7dc8bd7c285369..14d21ca5f933f3685e5b0a1be14dad6c9003fd76 100644 6 + --- a/lib/get-mapping.js 7 + +++ b/lib/get-mapping.js 8 + @@ -1,3 +1,5 @@ 9 + +// Contains patch from https://github.com/istanbuljs/istanbuljs/pull/837 10 + + 11 + /* 12 + Copyright 2015, Yahoo Inc. 13 + Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. 14 + @@ -36,13 +38,27 @@ function originalEndPositionFor(sourceMap, generatedEnd) { 15 + // generated file end location. Note however that this position on its 16 + // own is not useful because it is the position of the _start_ of the range 17 + // on the original file, and we want the _end_ of the range. 18 + - const beforeEndMapping = originalPositionTryBoth( 19 + + let beforeEndMapping = originalPositionTryBoth( 20 + sourceMap, 21 + generatedEnd.line, 22 + generatedEnd.column - 1 23 + ); 24 + if (beforeEndMapping.source === null) { 25 + - return null; 26 + + // search the previous lines as the mapping was not found on the same line 27 + + for ( 28 + + let line = generatedEnd.line; 29 + + line > 0 && beforeEndMapping.source === null; 30 + + line-- 31 + + ) { 32 + + beforeEndMapping = originalPositionTryBoth( 33 + + sourceMap, 34 + + line, 35 + + Infinity 36 + + ); 37 + + } 38 + + if (beforeEndMapping.source === null) { 39 + + return null; 40 + + } 41 + } 42 + 43 + // Convert that original position back to a generated one, with a bump
+7 -4
pnpm-lock.yaml
··· 140 140 cac@6.7.14: 141 141 hash: a8f0f3517a47ce716ed90c0cfe6ae382ab763b021a664ada2a608477d0621588 142 142 path: patches/cac@6.7.14.patch 143 + istanbul-lib-source-maps: 144 + hash: be977704c4b9838da456619fe2421b5e24df2103a25967bd383b2246c88ddf6e 145 + path: patches/istanbul-lib-source-maps.patch 143 146 144 147 importers: 145 148 ··· 595 598 istanbul-lib-report: 596 599 specifier: 'catalog:' 597 600 version: 3.0.1 598 - istanbul-lib-source-maps: 599 - specifier: 'catalog:' 600 - version: 5.0.6 601 601 istanbul-reports: 602 602 specifier: 'catalog:' 603 603 version: 3.2.0 ··· 626 626 '@types/istanbul-reports': 627 627 specifier: 'catalog:' 628 628 version: 3.0.4 629 + istanbul-lib-source-maps: 630 + specifier: 'catalog:' 631 + version: 5.0.6(patch_hash=be977704c4b9838da456619fe2421b5e24df2103a25967bd383b2246c88ddf6e) 629 632 pathe: 630 633 specifier: 'catalog:' 631 634 version: 2.0.3 ··· 15091 15094 make-dir: 4.0.0 15092 15095 supports-color: 7.2.0 15093 15096 15094 - istanbul-lib-source-maps@5.0.6: 15097 + istanbul-lib-source-maps@5.0.6(patch_hash=be977704c4b9838da456619fe2421b5e24df2103a25967bd383b2246c88ddf6e): 15095 15098 dependencies: 15096 15099 '@jridgewell/trace-mapping': 0.3.31 15097 15100 debug: 4.4.3
+1
pnpm-workspace.yaml
··· 41 41 '@types/sinonjs__fake-timers@8.1.5': patches/@types__sinonjs__fake-timers@8.1.5.patch 42 42 acorn@8.11.3: patches/acorn@8.11.3.patch 43 43 cac@6.7.14: patches/cac@6.7.14.patch 44 + istanbul-lib-source-maps: patches/istanbul-lib-source-maps.patch 44 45 catalog: 45 46 '@iconify-json/carbon': ^1.2.14 46 47 '@iconify-json/logos': ^1.2.10