@cloudflare/vitest-pool-workers 0.14.1 → 0.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/pool/index.mjs
CHANGED
|
@@ -12092,6 +12092,21 @@ function cloudflareTest(options) {
|
|
|
12092
12092
|
config.test ??= {};
|
|
12093
12093
|
config.test.server ??= {};
|
|
12094
12094
|
config.test.server.deps ??= {};
|
|
12095
|
+
const coverage = config.test.coverage;
|
|
12096
|
+
if (coverage && coverage.enabled) {
|
|
12097
|
+
const provider = "provider" in coverage ? coverage.provider : void 0;
|
|
12098
|
+
if (provider === "v8" || provider === void 0) throw new Error([
|
|
12099
|
+
"Coverage provider \"v8\" is not supported by `@cloudflare/vitest-pool-workers`.",
|
|
12100
|
+
"V8 native coverage requires `node:inspector` which is not functional in the Workers runtime.",
|
|
12101
|
+
"",
|
|
12102
|
+
"Use Istanbul instead — it works by instrumenting source code and runs on any JavaScript runtime:",
|
|
12103
|
+
"",
|
|
12104
|
+
" 1. Install: npm i -D @vitest/coverage-istanbul",
|
|
12105
|
+
" 2. Set `test.coverage.provider` to \"istanbul\" in your Vitest config",
|
|
12106
|
+
"",
|
|
12107
|
+
"See https://vitest.dev/guide/coverage#istanbul-provider for more details."
|
|
12108
|
+
].join("\n"));
|
|
12109
|
+
}
|
|
12095
12110
|
config.test.server.deps.inline = true;
|
|
12096
12111
|
ensureArrayExcludes(config.resolve.conditions, ["node"]);
|
|
12097
12112
|
ensureArrayIncludes(config.resolve.conditions, requiredConditions);
|