summaryrefslogtreecommitdiff
path: root/tests/specs/npm/npmrc_deno_json
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2024-05-23 22:26:23 +0100
committerGitHub <noreply@github.com>2024-05-23 23:26:23 +0200
commit959739f609dddacde3bbe9ecede2f409214fb34c (patch)
tree04d1776efbd3561205829f78288d26b6e14c3429 /tests/specs/npm/npmrc_deno_json
parent5de30c53239ac74843725d981afc0bb8c45bdf16 (diff)
FUTURE: initial support for .npmrc file (#23560)
This commit adds initial support for ".npmrc" files. Currently we only discover ".npmrc" files next to "package.json" files and discovering these files in user home dir is left for a follow up. This pass supports "_authToken" and "_auth" configuration for providing authentication. LSP support has been left for a follow up PR. Towards https://github.com/denoland/deno/issues/16105
Diffstat (limited to 'tests/specs/npm/npmrc_deno_json')
-rw-r--r--tests/specs/npm/npmrc_deno_json/.npmrc2
-rw-r--r--tests/specs/npm/npmrc_deno_json/__test__.jsonc8
-rw-r--r--tests/specs/npm/npmrc_deno_json/deno.json3
-rw-r--r--tests/specs/npm/npmrc_deno_json/main.js5
-rw-r--r--tests/specs/npm/npmrc_deno_json/main.out4
5 files changed, 22 insertions, 0 deletions
diff --git a/tests/specs/npm/npmrc_deno_json/.npmrc b/tests/specs/npm/npmrc_deno_json/.npmrc
new file mode 100644
index 000000000..18887e8d3
--- /dev/null
+++ b/tests/specs/npm/npmrc_deno_json/.npmrc
@@ -0,0 +1,2 @@
+@denotest:registry=http://127.0.0.1:4261/
+//127.0.0.1:4261/denotest/:_authToken=private-reg-token
diff --git a/tests/specs/npm/npmrc_deno_json/__test__.jsonc b/tests/specs/npm/npmrc_deno_json/__test__.jsonc
new file mode 100644
index 000000000..5d07b7034
--- /dev/null
+++ b/tests/specs/npm/npmrc_deno_json/__test__.jsonc
@@ -0,0 +1,8 @@
+{
+ "envs": {
+ "DENO_FUTURE": "1"
+ },
+ "tempDir": true,
+ "args": "run -A main.js",
+ "output": "main.out"
+}
diff --git a/tests/specs/npm/npmrc_deno_json/deno.json b/tests/specs/npm/npmrc_deno_json/deno.json
new file mode 100644
index 000000000..f6ca8454c
--- /dev/null
+++ b/tests/specs/npm/npmrc_deno_json/deno.json
@@ -0,0 +1,3 @@
+{
+ "imports": {}
+}
diff --git a/tests/specs/npm/npmrc_deno_json/main.js b/tests/specs/npm/npmrc_deno_json/main.js
new file mode 100644
index 000000000..9246715d1
--- /dev/null
+++ b/tests/specs/npm/npmrc_deno_json/main.js
@@ -0,0 +1,5 @@
+import { getValue, setValue } from "npm:@denotest/basic";
+
+console.log(getValue());
+setValue(42);
+console.log(getValue());
diff --git a/tests/specs/npm/npmrc_deno_json/main.out b/tests/specs/npm/npmrc_deno_json/main.out
new file mode 100644
index 000000000..6a1e47669
--- /dev/null
+++ b/tests/specs/npm/npmrc_deno_json/main.out
@@ -0,0 +1,4 @@
+Download http://127.0.0.1:4261/@denotest/basic
+Download http://localhost:4261/@denotest/basic/1.0.0.tgz
+0
+42