@cloudflare/vitest-pool-workers 0.15.2 → 0.16.0

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.
@@ -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,6 +9583,7 @@ 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",
@@ -9619,6 +9619,7 @@ var validatePreviewsConfig = /* @__PURE__ */ __name((envName) => (diagnostics, f
9619
9619
  isValid2 = validateBindingArray(envName, validateSecretsStoreSecretBinding)(diagnostics, `${field}.secrets_store_secrets`, previews.secrets_store_secrets, void 0) && isValid2;
9620
9620
  isValid2 = validateBindingArray(envName, validateArtifactsBinding)(diagnostics, `${field}.artifacts`, previews.artifacts, void 0) && isValid2;
9621
9621
  isValid2 = validateBindingArray(envName, validateHelloWorldBinding)(diagnostics, `${field}.unsafe_hello_world`, previews.unsafe_hello_world, void 0) && isValid2;
9622
+ isValid2 = validateBindingArray(envName, validateFlagshipBinding)(diagnostics, `${field}.flagship`, previews.flagship, void 0) && isValid2;
9622
9623
  isValid2 = validateBindingArray(envName, validateWorkerLoaderBinding)(diagnostics, `${field}.worker_loaders`, previews.worker_loaders, void 0) && isValid2;
9623
9624
  isValid2 = validateBindingArray(envName, validateRateLimitBinding)(diagnostics, `${field}.ratelimits`, previews.ratelimits, void 0) && isValid2;
9624
9625
  isValid2 = validateBindingArray(envName, validateVpcServiceBinding)(diagnostics, `${field}.vpc_services`, previews.vpc_services, void 0) && isValid2;
@@ -13133,6 +13134,13 @@ const RUNNER_OBJECT_BINDING = "__VITEST_POOL_WORKERS_RUNNER_OBJECT";
13133
13134
  async function buildProjectWorkerOptions(project, customOptions, main) {
13134
13135
  const relativeWranglerConfigPath = maybeApply((v) => path.relative("", v), customOptions.wrangler?.configPath);
13135
13136
  const runnerWorker = customOptions.miniflare ?? {};
13137
+ const wranglerWorkerName = getWranglerWorkerName(relativeWranglerConfigPath);
13138
+ if (wranglerWorkerName && runnerWorker.serviceBindings) {
13139
+ for (const [key, sb] of Object.entries(runnerWorker.serviceBindings)) if (typeof sb === "object" && sb !== null && "name" in sb && sb.name === wranglerWorkerName) runnerWorker.serviceBindings[key] = {
13140
+ ...sb,
13141
+ name: kCurrentWorker
13142
+ };
13143
+ }
13136
13144
  runnerWorker.name = getRunnerName(project);
13137
13145
  runnerWorker.compatibilityFlags ??= [];
13138
13146
  runnerWorker.compatibilityFlags.push("no_handle_cross_request_promise_resolution");