Skip to content

Commit

Permalink
fix: bundling error in @vitest/coverage-v8
Browse files Browse the repository at this point in the history
Upstream fix in vitest-dev/vitest#5549
  • Loading branch information
dschmidt committed Apr 22, 2024
1 parent 4f37572 commit cf1047f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
}
},
"patchedDependencies": {
"@vitest/coverage-v8@1.5.0": "patches/vitest-coverage-v8@1.5.0.patch",
"caf@15.0.1": "patches/caf@15.0.1.patch",
"vue3-gettext@2.4.0": "patches/vue3-gettext@2.4.0.patch",
"portal-vue@3.0.0": "patches/portal-vue@3.0.0.patch",
Expand Down
21 changes: 21 additions & 0 deletions patches/vitest-coverage-v8@1.5.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/dist/provider.js b/dist/provider.js
index e1eb11d..a815f1c 100644
--- a/dist/provider.js
+++ b/dist/provider.js
@@ -1800,14 +1800,8 @@ const CovBranch = requireBranch();
const CovFunction = require_function();
const CovSource = requireSource();
const { sliceRange } = requireRange();
-const compatError = Error(`requires Node.js ${require$$9.engines.node}`);
-const { readFileSync } = require$$10;
-let readFile = () => { throw compatError };
-try {
- readFile = require('fs').promises.readFile;
-} catch (_err) {
- // most likely we're on an older version of Node.js.
-}
+const { readFileSync } = require$$9;
+const readFile = promises.readFile;
const { TraceMap } = requireTraceMapping_umd();
const isOlderNode10 = /^v10\.(([0-9]\.)|(1[0-5]\.))/u.test(process.version);
const isNode8 = /^v8\./.test(process.version);
8 changes: 6 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cf1047f

Please sign in to comment.