@cloudflare/vitest-pool-workers 0.16.5 → 0.16.6
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 +16 -8
- package/dist/pool/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/pool/index.mjs
CHANGED
|
@@ -461,7 +461,7 @@ var MetricsRegistry = class {
|
|
|
461
461
|
};
|
|
462
462
|
|
|
463
463
|
//#endregion
|
|
464
|
-
//#region ../workers-utils/dist/chunk-
|
|
464
|
+
//#region ../workers-utils/dist/chunk-GMTGAG26.mjs
|
|
465
465
|
var UserError = class extends Error {
|
|
466
466
|
static {
|
|
467
467
|
__name(this, "UserError");
|
|
@@ -2858,8 +2858,15 @@ function findRedirectedWranglerConfig(cwd, userConfigPath) {
|
|
|
2858
2858
|
};
|
|
2859
2859
|
}
|
|
2860
2860
|
__name(findRedirectedWranglerConfig, "findRedirectedWranglerConfig");
|
|
2861
|
+
function isRedirectedConfig(config) {
|
|
2862
|
+
return config.configPath !== void 0 && config.configPath !== config.userConfigPath;
|
|
2863
|
+
}
|
|
2864
|
+
__name(isRedirectedConfig, "isRedirectedConfig");
|
|
2861
2865
|
function isRedirectedRawConfig(rawConfig, configPath, userConfigPath) {
|
|
2862
|
-
return
|
|
2866
|
+
return isRedirectedConfig({
|
|
2867
|
+
configPath,
|
|
2868
|
+
userConfigPath
|
|
2869
|
+
});
|
|
2863
2870
|
}
|
|
2864
2871
|
__name(isRedirectedRawConfig, "isRedirectedRawConfig");
|
|
2865
2872
|
function configFormat(configPath) {
|
|
@@ -7707,9 +7714,9 @@ function normalizeAndValidateConfig(rawConfig, configPath, userConfigPath, args,
|
|
|
7707
7714
|
if (useServiceEnvironments) diagnostics.warnings.push("Service environments are deprecated, and will be removed in the future. DO NOT USE IN PRODUCTION.");
|
|
7708
7715
|
const isDispatchNamespace = typeof args["dispatch-namespace"] === "string" && args["dispatch-namespace"].trim() !== "";
|
|
7709
7716
|
const topLevelEnv = normalizeAndValidateEnvironment(diagnostics, configPath, rawConfig, isDispatchNamespace, preserveOriginalMain);
|
|
7710
|
-
const
|
|
7717
|
+
const isRedirectedConfig2 = isRedirectedRawConfig(rawConfig, configPath, userConfigPath);
|
|
7711
7718
|
const definedEnvironments = Object.keys(rawConfig.env ?? {});
|
|
7712
|
-
if (
|
|
7719
|
+
if (isRedirectedConfig2 && definedEnvironments.length > 0) diagnostics.errors.push(dedent`
|
|
7713
7720
|
Redirected configurations cannot include environments but the following have been found:\n${definedEnvironments.map((env) => ` - ${env}`).join("\n")}
|
|
7714
7721
|
|
|
7715
7722
|
|
|
@@ -7720,7 +7727,7 @@ function normalizeAndValidateConfig(rawConfig, configPath, userConfigPath, args,
|
|
|
7720
7727
|
const envName = args.env ?? getCloudflareEnv();
|
|
7721
7728
|
assert(envName === void 0 || typeof envName === "string");
|
|
7722
7729
|
let activeEnv = topLevelEnv;
|
|
7723
|
-
if (envName) if (
|
|
7730
|
+
if (envName) if (isRedirectedConfig2) {
|
|
7724
7731
|
if (!isPagesConfig(rawConfig) && rawConfig.targetEnvironment && rawConfig.targetEnvironment !== envName) {
|
|
7725
7732
|
const via = args.env !== void 0 ? "via the `--env/-e` CLI argument" : "via the CLOUDFLARE_ENV environment variable";
|
|
7726
7733
|
throw new Error(dedent`
|
|
@@ -7752,9 +7759,9 @@ Consider adding an environment configuration section to the ${configFileName(con
|
|
|
7752
7759
|
const config = {
|
|
7753
7760
|
configPath,
|
|
7754
7761
|
userConfigPath,
|
|
7755
|
-
topLevelName:
|
|
7756
|
-
definedEnvironments:
|
|
7757
|
-
targetEnvironment:
|
|
7762
|
+
topLevelName: isRedirectedConfig2 ? rawConfig.topLevelName : rawConfig.name,
|
|
7763
|
+
definedEnvironments: isRedirectedConfig2 ? rawConfig.definedEnvironments : definedEnvironments,
|
|
7764
|
+
targetEnvironment: isRedirectedConfig2 ? rawConfig.targetEnvironment : envName,
|
|
7758
7765
|
pages_build_output_dir: normalizeAndValidatePagesBuildOutputDir(configPath, rawConfig.pages_build_output_dir),
|
|
7759
7766
|
legacy_env: !useServiceEnvironments,
|
|
7760
7767
|
send_metrics: rawConfig.send_metrics,
|
|
@@ -13066,6 +13073,7 @@ const ignoreMessages = [
|
|
|
13066
13073
|
"disconnected: operation canceled",
|
|
13067
13074
|
"disconnected: worker_do_not_log; Request failed due to internal error",
|
|
13068
13075
|
"disconnected: WebSocket was aborted",
|
|
13076
|
+
"disconnected: WebSocket peer disconnected",
|
|
13069
13077
|
"CODE_MOVED for unknown code block",
|
|
13070
13078
|
"broken.outputGateBroken; jsg.Error: Instance dispose"
|
|
13071
13079
|
];
|