summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/specs/npm/npmrc_homedir/.npmrc4
-rw-r--r--tests/specs/npm/npmrc_homedir/__test__.jsonc11
-rw-r--r--tests/specs/npm/npmrc_homedir/install.out9
-rw-r--r--tests/specs/npm/npmrc_homedir/subdir/main.js8
-rw-r--r--tests/specs/npm/npmrc_homedir/subdir/package.json8
-rw-r--r--tests/util/server/src/builders.rs2
6 files changed, 42 insertions, 0 deletions
diff --git a/tests/specs/npm/npmrc_homedir/.npmrc b/tests/specs/npm/npmrc_homedir/.npmrc
new file mode 100644
index 000000000..13552ad61
--- /dev/null
+++ b/tests/specs/npm/npmrc_homedir/.npmrc
@@ -0,0 +1,4 @@
+@denotest:registry=http://localhost:4261/
+//localhost:4261/:_authToken=private-reg-token
+@denotest2:registry=http://localhost:4262/
+//localhost:4262/:_authToken=private-reg-token2
diff --git a/tests/specs/npm/npmrc_homedir/__test__.jsonc b/tests/specs/npm/npmrc_homedir/__test__.jsonc
new file mode 100644
index 000000000..26fce7fd8
--- /dev/null
+++ b/tests/specs/npm/npmrc_homedir/__test__.jsonc
@@ -0,0 +1,11 @@
+{
+ "if": "unix",
+ "tempDir": true,
+ "envs": {
+ "DENO_FUTURE": "1",
+ "HOME": "$PWD/../"
+ },
+ "cwd": "subdir",
+ "args": "install",
+ "output": "install.out"
+}
diff --git a/tests/specs/npm/npmrc_homedir/install.out b/tests/specs/npm/npmrc_homedir/install.out
new file mode 100644
index 000000000..5c2ff3562
--- /dev/null
+++ b/tests/specs/npm/npmrc_homedir/install.out
@@ -0,0 +1,9 @@
+⚠️ `deno install` behavior will change in Deno 2. To preserve the current behavior use the `-g` or `--global` flag.
+[UNORDERED_START]
+Download http://localhost:4261/@denotest/basic
+Download http://localhost:4262/@denotest2/basic
+Download http://localhost:4261/@denotest/basic/1.0.0.tgz
+Download http://localhost:4262/@denotest2/basic/1.0.0.tgz
+Initialize @denotest2/basic@1.0.0
+Initialize @denotest/basic@1.0.0
+[UNORDERED_END]
diff --git a/tests/specs/npm/npmrc_homedir/subdir/main.js b/tests/specs/npm/npmrc_homedir/subdir/main.js
new file mode 100644
index 000000000..66b393636
--- /dev/null
+++ b/tests/specs/npm/npmrc_homedir/subdir/main.js
@@ -0,0 +1,8 @@
+import { getValue, setValue } from "@denotest/basic";
+import * as test from "@denotest2/basic";
+
+console.log(getValue());
+setValue(42);
+console.log(getValue());
+
+console.log(test.getValue());
diff --git a/tests/specs/npm/npmrc_homedir/subdir/package.json b/tests/specs/npm/npmrc_homedir/subdir/package.json
new file mode 100644
index 000000000..274d1ed7f
--- /dev/null
+++ b/tests/specs/npm/npmrc_homedir/subdir/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "npmrc_test",
+ "version": "0.0.1",
+ "dependencies": {
+ "@denotest/basic": "1.0.0",
+ "@denotest2/basic": "1.0.0"
+ }
+}
diff --git a/tests/util/server/src/builders.rs b/tests/util/server/src/builders.rs
index 58563bd03..4130a44e7 100644
--- a/tests/util/server/src/builders.rs
+++ b/tests/util/server/src/builders.rs
@@ -32,6 +32,7 @@ use crate::npm_registry_unset_url;
use crate::pty::Pty;
use crate::strip_ansi_codes;
use crate::testdata_path;
+use crate::tests_path;
use crate::HttpServerGuard;
use crate::TempDir;
@@ -837,6 +838,7 @@ impl TestCommandBuilder {
text
.replace("$DENO_DIR", &self.deno_dir.path().to_string_lossy())
.replace("$TESTDATA", &testdata_path().to_string_lossy())
+ .replace("$TESTS", &tests_path().to_string_lossy())
.replace("$PWD", &cwd.to_string_lossy())
}
}