diff options
author | Marvin Hagemeister <marvin@deno.com> | 2024-10-24 20:03:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-24 20:03:56 +0200 |
commit | 5f0bb3c6f4328003012e98ba70ce18e4e2e842de (patch) | |
tree | 5d99b6f2868c70b105ca4ff83f2a7380f4da9ac5 /tests/util/server/src/servers/npm_registry.rs | |
parent | c71e020668b40666aecfdffb1dbf979abcb41958 (diff) |
fix: `.npmrc` settings not being passed to install/add command (#26473)
We weren't passing the resolved npmrc settings to the install commands.
This lead us to always fall back to the default registry url instead of
using the one from npmrc.
Fixes https://github.com/denoland/deno/issues/26139
Fixes https://github.com/denoland/deno/issues/26033
Fixes https://github.com/denoland/deno/issues/25924
Fixes https://github.com/denoland/deno/issues/25822
Fixes https://github.com/denoland/deno/issues/26152
---------
Co-authored-by: Bartek IwaĆczuk <biwanczuk@gmail.com>
Diffstat (limited to 'tests/util/server/src/servers/npm_registry.rs')
-rw-r--r-- | tests/util/server/src/servers/npm_registry.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/util/server/src/servers/npm_registry.rs b/tests/util/server/src/servers/npm_registry.rs index acbd9cab4..4ada468fa 100644 --- a/tests/util/server/src/servers/npm_registry.rs +++ b/tests/util/server/src/servers/npm_registry.rs @@ -56,6 +56,14 @@ pub fn private_npm_registry2(port: u16) -> Vec<LocalBoxFuture<'static, ()>> { ) } +pub fn private_npm_registry3(port: u16) -> Vec<LocalBoxFuture<'static, ()>> { + run_npm_server( + port, + "npm private registry server error", + private_npm_registry3_handler, + ) +} + fn run_npm_server<F, S>( port: u16, error_msg: &'static str, @@ -141,6 +149,13 @@ async fn private_npm_registry2_handler( handle_req_for_registry(req, &npm::PRIVATE_TEST_NPM_REGISTRY_2).await } +async fn private_npm_registry3_handler( + req: Request<hyper::body::Incoming>, +) -> Result<Response<UnsyncBoxBody<Bytes, Infallible>>, anyhow::Error> { + // No auth for this registry + handle_req_for_registry(req, &npm::PRIVATE_TEST_NPM_REGISTRY_3).await +} + async fn handle_req_for_registry( req: Request<Incoming>, test_npm_registry: &npm::TestNpmRegistry, |