diff options
Diffstat (limited to 'test_util/src/lib.rs')
-rw-r--r-- | test_util/src/lib.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test_util/src/lib.rs b/test_util/src/lib.rs index b5d509945..5bbccacd8 100644 --- a/test_util/src/lib.rs +++ b/test_util/src/lib.rs @@ -49,6 +49,7 @@ use tokio::net::TcpStream; use tokio_rustls::rustls; use tokio_rustls::TlsAcceptor; use tokio_tungstenite::accept_async; +use url::Url; pub mod assertions; pub mod lsp; @@ -120,10 +121,19 @@ pub fn napi_tests_path() -> PathBuf { root_path().join("test_napi") } +/// Test server registry url. +pub fn npm_registry_url() -> String { + "http://localhost:4545/npm/registry/".to_string() +} + pub fn std_path() -> PathBuf { root_path().join("test_util").join("std") } +pub fn std_file_url() -> String { + Url::from_directory_path(std_path()).unwrap().to_string() +} + pub fn target_dir() -> PathBuf { let current_exe = std::env::current_exe().unwrap(); let target_dir = current_exe.parent().unwrap().parent().unwrap(); |