diff --git a/.changeset/soft-laws-doubt.md b/.changeset/soft-laws-doubt.md new file mode 100644 index 0000000..c9b9fdd --- /dev/null +++ b/.changeset/soft-laws-doubt.md @@ -0,0 +1,5 @@ +--- +"fnm": patch +--- + +fix test: Use correct PATH for npm install test diff --git a/src/downloader.rs b/src/downloader.rs index 7ba999b..866481f 100644 --- a/src/downloader.rs +++ b/src/downloader.rs @@ -152,13 +152,11 @@ mod tests { #[test_log::test] fn test_installing_npm() { let installations_dir = tempdir().unwrap(); - let npm_path = install_in(installations_dir.path()).join(if cfg!(windows) { - "npm.cmd" - } else { - "npm" - }); + let bin_dir = install_in(installations_dir.path()); + let npm_path = bin_dir.join(if cfg!(windows) { "npm.cmd" } else { "npm" }); let stdout = duct::cmd(npm_path.to_str().unwrap(), vec!["--version"]) + .env("PATH", bin_dir) .stdout_capture() .run() .expect("Can't run npm")