summaryrefslogtreecommitdiff
path: root/test_util/src/lib.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2022-11-28 21:59:36 +0100
committerGitHub <noreply@github.com>2022-11-28 21:59:36 +0100
commitfd51b2e506f3ea3cc49bfb2bcb19bc684f563f60 (patch)
tree7b8deca6a97e53048293d92cb471d1726e0e3a0f /test_util/src/lib.rs
parent9202611e3695c7091f257b261af809697df959ab (diff)
fix(npm): allow to inspect npm modules with --inspect-brk (#16841)
Diffstat (limited to 'test_util/src/lib.rs')
-rw-r--r--test_util/src/lib.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/test_util/src/lib.rs b/test_util/src/lib.rs
index 3b23af736..b1b14c004 100644
--- a/test_util/src/lib.rs
+++ b/test_util/src/lib.rs
@@ -94,6 +94,24 @@ lazy_static! {
static ref GUARD: Mutex<HttpServerCount> = Mutex::new(HttpServerCount::default());
}
+pub fn env_vars_for_npm_tests_no_sync_download() -> Vec<(String, String)> {
+ vec![
+ ("DENO_NODE_COMPAT_URL".to_string(), std_file_url()),
+ ("DENO_NPM_REGISTRY".to_string(), npm_registry_url()),
+ ("NO_COLOR".to_string(), "1".to_string()),
+ ]
+}
+
+pub fn env_vars_for_npm_tests() -> Vec<(String, String)> {
+ let mut env_vars = env_vars_for_npm_tests_no_sync_download();
+ env_vars.push((
+ // make downloads determinstic
+ "DENO_UNSTABLE_NPM_SYNC_DOWNLOAD".to_string(),
+ "1".to_string(),
+ ));
+ env_vars
+}
+
pub fn root_path() -> PathBuf {
PathBuf::from(concat!(env!("CARGO_MANIFEST_DIR")))
.parent()