Skip to content

Commit 27d5247

Browse files
committed
test(pm): serialize registry environment access
1 parent d6cb3e8 commit 27d5247

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

crates/vp_pm_cli/src/config.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,11 @@ mod tests {
241241
let project = project_with_npmrc(
242242
"registry=https://default.example/\n@yarnpkg:registry=https://yarn.example/\n",
243243
);
244-
let config = NpmConfig::load_for_project(Some(project.path().to_path_buf()));
245-
assert_eq!(config.registry_for_package(""), "https://default.example");
246-
assert_eq!(config.registry_for_package("@yarnpkg/cli-dist"), "https://yarn.example");
244+
EnvConfig::with_vars(std::iter::empty::<(&'static str, &'static str)>(), |_| {
245+
let config = NpmConfig::load_for_project(Some(project.path().to_path_buf()));
246+
assert_eq!(config.registry_for_package(""), "https://default.example");
247+
assert_eq!(config.registry_for_package("@yarnpkg/cli-dist"), "https://yarn.example");
248+
});
247249
}
248250

249251
#[test]

0 commit comments

Comments
 (0)