summaryrefslogtreecommitdiff
path: root/test_util/src/builders.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-09-18 10:46:44 -0400
committerGitHub <noreply@github.com>2023-09-18 10:46:44 -0400
commit0709c051f83c181206f6653396f5428df66ed74f (patch)
tree9360ce6cfc2c3f3f53a8a7af0f9d3bdc9e1ee553 /test_util/src/builders.rs
parent4fcd9a0de815a756e5f173e1bc1f84d90ba39ec7 (diff)
feat(unstable): package manager (#20517)
Adds an experimental unstable built-in package manager to Deno, but it is currently not usable because the registry infrastructure hasn't been setup and it points to a non-existent url by default. The default registry url can be configured via the `DENO_REGISTRY_URL` environment variable.
Diffstat (limited to 'test_util/src/builders.rs')
-rw-r--r--test_util/src/builders.rs20
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 {