diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2022-10-21 11:20:18 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-21 15:20:18 +0000 |
commit | bcfe279fba865763c87f9cd8d5a2d0b2cbf451be (patch) | |
tree | 68e4d1bc52e261df50279f9ecea14795d1c46f6c /test_util/src/lib.rs | |
parent | 0e1a71fec6fff5fe62d7e6b2bfffb7ab877d7b71 (diff) |
feat(unstable/npm): initial type checking of npm specifiers (#16332)
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(); |