Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
Test globals.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Aug 22, 2023
1 parent ea172a6 commit f257214
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crates/common/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ pub fn install_global(dependency: &str, globals_dir: &Path) -> ExecCommandInput
],
);

cmd.env_vars
.insert("PROTO_INSTALL_GLOBAL".into(), "true".into());

// Remove the /bin component
cmd.env_vars.insert(
"PREFIX".into(),
Expand All @@ -30,6 +33,9 @@ pub fn uninstall_global(dependency: &str, globals_dir: &Path) -> ExecCommandInpu
["uninstall", "--global", "--loglevel", "warn", dependency],
);

cmd.env_vars
.insert("PROTO_INSTALL_GLOBAL".into(), "true".into());

// Remove the /bin component
cmd.env_vars.insert(
"PREFIX".into(),
Expand Down
20 changes: 20 additions & 0 deletions crates/node-depman/tests/globals_test.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
use proto_pdk_test_utils::*;
use starbase_sandbox::create_empty_sandbox;

mod npm {
use super::*;

generate_globals_test!("npm-test", "prettier");
}

mod pnpm {
use super::*;

generate_globals_test!("pnpm-test", "prettier");
}

mod yarn {
use super::*;

generate_globals_test!("yarn-test", "prettier");
}
4 changes: 4 additions & 0 deletions crates/node/tests/globals_test.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
use proto_pdk_test_utils::*;
use starbase_sandbox::create_empty_sandbox;

generate_globals_test!("node-test", "prettier");

0 comments on commit f257214

Please sign in to comment.