diff options
-rw-r--r-- | Cargo.lock | 4 | ||||
-rw-r--r-- | cli/Cargo.toml | 2 | ||||
-rw-r--r-- | tests/specs/compile/npmrc/.npmrc | 4 | ||||
-rw-r--r-- | tests/specs/npm/npmrc/.npmrc | 4 | ||||
-rw-r--r-- | tests/specs/npm/npmrc_bad_registry_config/.npmrc | 5 | ||||
-rw-r--r-- | tests/specs/npm/npmrc_bad_registry_config/__test__.jsonc | 9 | ||||
-rw-r--r-- | tests/specs/npm/npmrc_bad_registry_config/main.js | 5 | ||||
-rw-r--r-- | tests/specs/npm/npmrc_bad_registry_config/main.out | 4 | ||||
-rw-r--r-- | tests/specs/npm/npmrc_bad_registry_config/package.json | 7 | ||||
-rw-r--r-- | tests/specs/npm/npmrc_bad_token/.npmrc | 2 | ||||
-rw-r--r-- | tests/specs/npm/npmrc_basic_auth/.npmrc | 4 | ||||
-rw-r--r-- | tests/specs/npm/npmrc_deno_json/.npmrc | 2 | ||||
-rw-r--r-- | tests/specs/npm/npmrc_not_next_to_package_json/.npmrc | 2 |
13 files changed, 42 insertions, 12 deletions
diff --git a/Cargo.lock b/Cargo.lock index b424ee82d..10313dca9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1734,9 +1734,9 @@ dependencies = [ [[package]] name = "deno_npm" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b99fac4a31098e2466f97576b53a9860d8e7ad1df2792a22d5b3209ca3bd2924" +checksum = "0971210ea837a8153c2e1bec7d65aabf372f436845e576db95c596c0f4b1209d" dependencies = [ "anyhow", "async-trait", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index d72ee794b..38cb8402b 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -72,7 +72,7 @@ deno_emit = "=0.42.0" deno_graph = { version = "=0.78.0", features = ["tokio_executor"] } deno_lint = { version = "=0.60.0", features = ["docs"] } deno_lockfile.workspace = true -deno_npm = "=0.21.0" +deno_npm = "=0.21.1" deno_runtime = { workspace = true, features = ["include_js_files_for_snapshotting"] } deno_semver = "=0.5.4" deno_task_shell = "=0.16.1" diff --git a/tests/specs/compile/npmrc/.npmrc b/tests/specs/compile/npmrc/.npmrc index 0624091f0..88c811ad6 100644 --- a/tests/specs/compile/npmrc/.npmrc +++ b/tests/specs/compile/npmrc/.npmrc @@ -1,4 +1,4 @@ @denotest:registry=http://127.0.0.1:4261/ -//127.0.0.1:4261/denotest/:_authToken=private-reg-token +//127.0.0.1:4261/:_authToken=private-reg-token @denotest2:registry=http://127.0.0.1:4262/ -//127.0.0.1:4262/denotest2/:_authToken=private-reg-token2 +//127.0.0.1:4262/:_authToken=private-reg-token2 diff --git a/tests/specs/npm/npmrc/.npmrc b/tests/specs/npm/npmrc/.npmrc index 085885ec8..88c811ad6 100644 --- a/tests/specs/npm/npmrc/.npmrc +++ b/tests/specs/npm/npmrc/.npmrc @@ -1,4 +1,4 @@ @denotest:registry=http://127.0.0.1:4261/ -//127.0.0.1:4261/denotest/:_auth=ZGVubzpsYW5k +//127.0.0.1:4261/:_authToken=private-reg-token @denotest2:registry=http://127.0.0.1:4262/ -//127.0.0.1:4262/denotest2/:_auth=ZGVubzpsYW5kMg== +//127.0.0.1:4262/:_authToken=private-reg-token2 diff --git a/tests/specs/npm/npmrc_bad_registry_config/.npmrc b/tests/specs/npm/npmrc_bad_registry_config/.npmrc new file mode 100644 index 000000000..709720a45 --- /dev/null +++ b/tests/specs/npm/npmrc_bad_registry_config/.npmrc @@ -0,0 +1,5 @@ +@denotest:registry=http://127.0.0.1:4261/ +; This configuration is wrong - the registry URL must +; be exactly the same as registry configured for the scope, +; not root url + scope name. +//127.0.0.1:4261/denotest/:_authToken=invalid-token diff --git a/tests/specs/npm/npmrc_bad_registry_config/__test__.jsonc b/tests/specs/npm/npmrc_bad_registry_config/__test__.jsonc new file mode 100644 index 000000000..fe99247b1 --- /dev/null +++ b/tests/specs/npm/npmrc_bad_registry_config/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "envs": { + "DENO_FUTURE": "1" + }, + "tempDir": true, + "args": "install", + "output": "main.out", + "exitCode": 1 +} diff --git a/tests/specs/npm/npmrc_bad_registry_config/main.js b/tests/specs/npm/npmrc_bad_registry_config/main.js new file mode 100644 index 000000000..e8ccf7611 --- /dev/null +++ b/tests/specs/npm/npmrc_bad_registry_config/main.js @@ -0,0 +1,5 @@ +import { getValue, setValue } from "@denotest/basic"; + +console.log(getValue()); +setValue(42); +console.log(getValue()); diff --git a/tests/specs/npm/npmrc_bad_registry_config/main.out b/tests/specs/npm/npmrc_bad_registry_config/main.out new file mode 100644 index 000000000..ceee1fed4 --- /dev/null +++ b/tests/specs/npm/npmrc_bad_registry_config/main.out @@ -0,0 +1,4 @@ +⚠️ `deno install` behavior will change in Deno 2. To preserve the current behavior use the `-g` or `--global` flag. +Download http://127.0.0.1:4261/@denotest/basic +error: Error getting response at http://127.0.0.1:4261/@denotest/basic for package "@denotest/basic": Bad response: 401 +[WILDCARD]
\ No newline at end of file diff --git a/tests/specs/npm/npmrc_bad_registry_config/package.json b/tests/specs/npm/npmrc_bad_registry_config/package.json new file mode 100644 index 000000000..b5ca7df42 --- /dev/null +++ b/tests/specs/npm/npmrc_bad_registry_config/package.json @@ -0,0 +1,7 @@ +{ + "name": "npmrc_test", + "version": "0.0.1", + "dependencies": { + "@denotest/basic": "1.0.0" + } +} diff --git a/tests/specs/npm/npmrc_bad_token/.npmrc b/tests/specs/npm/npmrc_bad_token/.npmrc index c4b03fd7a..6ead678f4 100644 --- a/tests/specs/npm/npmrc_bad_token/.npmrc +++ b/tests/specs/npm/npmrc_bad_token/.npmrc @@ -1,2 +1,2 @@ @denotest:registry=http://127.0.0.1:4261/ -//127.0.0.1:4261/denotest/:_authToken=invalid-token +//127.0.0.1:4261/:_authToken=invalid-token diff --git a/tests/specs/npm/npmrc_basic_auth/.npmrc b/tests/specs/npm/npmrc_basic_auth/.npmrc index 0624091f0..c5548f6f6 100644 --- a/tests/specs/npm/npmrc_basic_auth/.npmrc +++ b/tests/specs/npm/npmrc_basic_auth/.npmrc @@ -1,4 +1,4 @@ @denotest:registry=http://127.0.0.1:4261/ -//127.0.0.1:4261/denotest/:_authToken=private-reg-token +//127.0.0.1:4261/:_auth=ZGVubzpsYW5k @denotest2:registry=http://127.0.0.1:4262/ -//127.0.0.1:4262/denotest2/:_authToken=private-reg-token2 +//127.0.0.1:4262/:_auth=ZGVubzpsYW5kMg== diff --git a/tests/specs/npm/npmrc_deno_json/.npmrc b/tests/specs/npm/npmrc_deno_json/.npmrc index 18887e8d3..cea5a0fad 100644 --- a/tests/specs/npm/npmrc_deno_json/.npmrc +++ b/tests/specs/npm/npmrc_deno_json/.npmrc @@ -1,2 +1,2 @@ @denotest:registry=http://127.0.0.1:4261/ -//127.0.0.1:4261/denotest/:_authToken=private-reg-token +//127.0.0.1:4261/:_authToken=private-reg-token diff --git a/tests/specs/npm/npmrc_not_next_to_package_json/.npmrc b/tests/specs/npm/npmrc_not_next_to_package_json/.npmrc index 18887e8d3..cea5a0fad 100644 --- a/tests/specs/npm/npmrc_not_next_to_package_json/.npmrc +++ b/tests/specs/npm/npmrc_not_next_to_package_json/.npmrc @@ -1,2 +1,2 @@ @denotest:registry=http://127.0.0.1:4261/ -//127.0.0.1:4261/denotest/:_authToken=private-reg-token +//127.0.0.1:4261/:_authToken=private-reg-token |