diff options
Diffstat (limited to 'test_util/src/builders.rs')
-rw-r--r-- | test_util/src/builders.rs | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/test_util/src/builders.rs b/test_util/src/builders.rs index 769c054bf..17871baa1 100644 --- a/test_util/src/builders.rs +++ b/test_util/src/builders.rs @@ -15,7 +15,8 @@ use os_pipe::pipe; use crate::assertions::assert_wildcard_match; use crate::deno_exe_path; -use crate::env_vars_for_npm_tests_no_sync_download; +use crate::env_vars_for_jsr_tests; +use crate::env_vars_for_npm_tests; use crate::fs::PathRef; use crate::http_server; use crate::lsp::LspClientBuilder; @@ -50,6 +51,10 @@ impl TestContextBuilder { Self::new().use_http_server().add_npm_env_vars() } + pub fn for_jsr() -> Self { + Self::new().use_http_server().add_jsr_env_vars() + } + pub fn temp_dir_path(mut self, path: impl AsRef<Path>) -> Self { self.temp_dir_path = Some(path.as_ref().to_path_buf()); self @@ -98,18 +103,17 @@ impl TestContextBuilder { } pub fn add_npm_env_vars(mut self) -> Self { - for (key, value) in env_vars_for_npm_tests_no_sync_download() { + for (key, value) in env_vars_for_npm_tests() { self = self.env(key, value); } self } - pub fn use_sync_npm_download(self) -> Self { - self.env( - // make downloads deterministic - "DENO_UNSTABLE_NPM_SYNC_DOWNLOAD", - "1", - ) + pub fn add_jsr_env_vars(mut self) -> Self { + for (key, value) in env_vars_for_jsr_tests() { + self = self.env(key, value); + } + self } pub fn build(&self) -> TestContext { |