@cloudflare/vitest-pool-workers 0.15.2 → 0.16.1
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 +12 -2
- package/dist/pool/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/pool/index.mjs
CHANGED
|
@@ -8084,7 +8084,6 @@ var validateStreamingTailConsumers = /* @__PURE__ */ __name((diagnostics, field,
|
|
|
8084
8084
|
function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDispatchNamespace, preserveOriginalMain, envName = "top level", topLevelEnv, useServiceEnvironments, rawConfig) {
|
|
8085
8085
|
deprecated(diagnostics, rawEnv, "node_compat", `The "node_compat" field is no longer supported as of Wrangler v4. Instead, use the \`nodejs_compat\` compatibility flag. This includes the functionality from legacy \`node_compat\` polyfills and natively implemented Node.js APIs. See https://developers.cloudflare.com/workers/runtime-apis/nodejs for more information.`, true, "Removed", "error");
|
|
8086
8086
|
experimental(diagnostics, rawEnv, "unsafe");
|
|
8087
|
-
experimental(diagnostics, rawEnv, "secrets");
|
|
8088
8087
|
const route = normalizeAndValidateRoute(diagnostics, topLevelEnv, rawEnv);
|
|
8089
8088
|
const account_id = inheritableInWranglerEnvironments(diagnostics, useServiceEnvironments, topLevelEnv, mutateEmptyStringAccountIDValue(diagnostics, rawEnv), "account_id", isString, void 0, void 0);
|
|
8090
8089
|
const routes = validateRoutes(diagnostics, topLevelEnv, rawEnv);
|
|
@@ -9584,13 +9583,15 @@ var validatePreviewsConfig = /* @__PURE__ */ __name((envName) => (diagnostics, f
|
|
|
9584
9583
|
"secrets_store_secrets",
|
|
9585
9584
|
"artifacts",
|
|
9586
9585
|
"unsafe_hello_world",
|
|
9586
|
+
"flagship",
|
|
9587
9587
|
"worker_loaders",
|
|
9588
9588
|
"ratelimits",
|
|
9589
9589
|
"vpc_services",
|
|
9590
9590
|
"version_metadata",
|
|
9591
9591
|
"logpush",
|
|
9592
9592
|
"observability",
|
|
9593
|
-
"limits"
|
|
9593
|
+
"limits",
|
|
9594
|
+
"cache"
|
|
9594
9595
|
]) && isValid2;
|
|
9595
9596
|
isValid2 = validateVars(envName)(diagnostics, `${field}.vars`, previews.vars, void 0) && isValid2;
|
|
9596
9597
|
isValid2 = validateDefines(envName)(diagnostics, `${field}.define`, previews.define, void 0) && isValid2;
|
|
@@ -9619,6 +9620,7 @@ var validatePreviewsConfig = /* @__PURE__ */ __name((envName) => (diagnostics, f
|
|
|
9619
9620
|
isValid2 = validateBindingArray(envName, validateSecretsStoreSecretBinding)(diagnostics, `${field}.secrets_store_secrets`, previews.secrets_store_secrets, void 0) && isValid2;
|
|
9620
9621
|
isValid2 = validateBindingArray(envName, validateArtifactsBinding)(diagnostics, `${field}.artifacts`, previews.artifacts, void 0) && isValid2;
|
|
9621
9622
|
isValid2 = validateBindingArray(envName, validateHelloWorldBinding)(diagnostics, `${field}.unsafe_hello_world`, previews.unsafe_hello_world, void 0) && isValid2;
|
|
9623
|
+
isValid2 = validateBindingArray(envName, validateFlagshipBinding)(diagnostics, `${field}.flagship`, previews.flagship, void 0) && isValid2;
|
|
9622
9624
|
isValid2 = validateBindingArray(envName, validateWorkerLoaderBinding)(diagnostics, `${field}.worker_loaders`, previews.worker_loaders, void 0) && isValid2;
|
|
9623
9625
|
isValid2 = validateBindingArray(envName, validateRateLimitBinding)(diagnostics, `${field}.ratelimits`, previews.ratelimits, void 0) && isValid2;
|
|
9624
9626
|
isValid2 = validateBindingArray(envName, validateVpcServiceBinding)(diagnostics, `${field}.vpc_services`, previews.vpc_services, void 0) && isValid2;
|
|
@@ -9629,6 +9631,7 @@ var validatePreviewsConfig = /* @__PURE__ */ __name((envName) => (diagnostics, f
|
|
|
9629
9631
|
isValid2 = validateOptionalProperty(diagnostics, `${field}.limits`, "cpu_ms", previews.limits.cpu_ms, "number") && isValid2;
|
|
9630
9632
|
isValid2 = validateOptionalProperty(diagnostics, `${field}.limits`, "subrequests", previews.limits.subrequests, "number") && isValid2;
|
|
9631
9633
|
}
|
|
9634
|
+
isValid2 = validateCache(diagnostics, `${field}.cache`, previews.cache, void 0) && isValid2;
|
|
9632
9635
|
return isValid2;
|
|
9633
9636
|
}, "validatePreviewsConfig");
|
|
9634
9637
|
var validateMigrations = /* @__PURE__ */ __name((diagnostics, field, value) => {
|
|
@@ -13133,6 +13136,13 @@ const RUNNER_OBJECT_BINDING = "__VITEST_POOL_WORKERS_RUNNER_OBJECT";
|
|
|
13133
13136
|
async function buildProjectWorkerOptions(project, customOptions, main) {
|
|
13134
13137
|
const relativeWranglerConfigPath = maybeApply((v) => path.relative("", v), customOptions.wrangler?.configPath);
|
|
13135
13138
|
const runnerWorker = customOptions.miniflare ?? {};
|
|
13139
|
+
const wranglerWorkerName = getWranglerWorkerName(relativeWranglerConfigPath);
|
|
13140
|
+
if (wranglerWorkerName && runnerWorker.serviceBindings) {
|
|
13141
|
+
for (const [key, sb] of Object.entries(runnerWorker.serviceBindings)) if (typeof sb === "object" && sb !== null && "name" in sb && sb.name === wranglerWorkerName) runnerWorker.serviceBindings[key] = {
|
|
13142
|
+
...sb,
|
|
13143
|
+
name: kCurrentWorker
|
|
13144
|
+
};
|
|
13145
|
+
}
|
|
13136
13146
|
runnerWorker.name = getRunnerName(project);
|
|
13137
13147
|
runnerWorker.compatibilityFlags ??= [];
|
|
13138
13148
|
runnerWorker.compatibilityFlags.push("no_handle_cross_request_promise_resolution");
|