Skip to content

Commit b41ce83

Browse files
mikolalysenkoclaude
andcommitted
test(hosted): match the allow-remote env var name case-insensitively
On Windows env var names are case-insensitive: run_isolated blanks NPM_CONFIG_ALLOW_REMOTE before the test sets npm_config_allow_remote=none, so the child sees a single variable under the first spelling and the warning (which names the variable as the OS reports it) says NPM_CONFIG_ALLOW_REMOTE=none. The product is right; the assertion was POSIX-only. Fixes outer_npm_config_layers_are_respected on test (windows-latest) after #251. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent 872b591 commit b41ce83

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎crates/socket-patch-cli/tests/redirect_npm_allow_remote.rs‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,9 +714,15 @@ async fn outer_npm_config_layers_are_respected() {
714714
&[("npm_config_allow_remote", "none")],
715715
);
716716
assert_eq!(code, 0, "{stderr}");
717+
// The warning names the variable as the OS reports it. Windows env names
718+
// are case-insensitive, and `scan_hosted_env`'s blanking of
719+
// `NPM_CONFIG_ALLOW_REMOTE` makes the child see that spelling there, so
720+
// match the name case-insensitively.
717721
assert!(
718722
stderr.contains(&format!("Warning ({CODE}): "))
719-
&& stderr.contains("npm_config_allow_remote=none")
723+
&& stderr
724+
.to_ascii_lowercase()
725+
.contains("npm_config_allow_remote=none")
720726
&& stderr.contains("would not take effect"),
721727
"{stderr}"
722728
);

0 commit comments

Comments
 (0)