Browse Source

fix: Use correct PATH for npm install test (#768)

* fix: Use correct PATH for npm install test

Resolves: https://github.com/Schniz/fnm/issues/755

* Create soft-laws-doubt.md

Co-authored-by: Gal Schlezinger <gal@spitfire.co.il>
remotes/origin/feat/support-install-latest
Alexey Zapparov 3 years ago committed by GitHub
parent
commit
d62e17d667
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      .changeset/soft-laws-doubt.md
  2. 8
      src/downloader.rs

5
.changeset/soft-laws-doubt.md

@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
---
"fnm": patch
---
fix test: Use correct PATH for npm install test

8
src/downloader.rs

@ -152,13 +152,11 @@ mod tests { @@ -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")

Loading…
Cancel
Save