summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/integration/npm_tests.rs21
-rw-r--r--cli/tests/testdata/npm/registry/@denotest/bin/0.5.0/package.json2
-rw-r--r--cli/tests/testdata/npm/registry/@denotest/bin/0.6.0/package.json2
-rw-r--r--cli/tests/testdata/npm/registry/@denotest/bin/1.0.0/package.json2
-rw-r--r--cli/tests/testdata/npm/run_existing_npm_package/main.out3
-rw-r--r--cli/tests/testdata/npm/run_existing_npm_package/package.json6
-rw-r--r--cli/tests/testdata/npm/run_existing_npm_package_with_subpath/main.out5
-rw-r--r--cli/tests/testdata/npm/run_existing_npm_package_with_subpath/package.json6
8 files changed, 44 insertions, 3 deletions
diff --git a/cli/tests/integration/npm_tests.rs b/cli/tests/integration/npm_tests.rs
index edd100d7d..09330a80c 100644
--- a/cli/tests/integration/npm_tests.rs
+++ b/cli/tests/integration/npm_tests.rs
@@ -448,6 +448,27 @@ itest!(permissions_outside_package {
http_server: true,
});
+itest!(run_existing_npm_package {
+ args: "run --allow-read --node-modules-dir npm:@denotest/bin",
+ output: "npm/run_existing_npm_package/main.out",
+ envs: env_vars_for_npm_tests(),
+ http_server: true,
+ temp_cwd: true,
+ cwd: Some("npm/run_existing_npm_package/"),
+ copy_temp_dir: Some("npm/run_existing_npm_package/"),
+});
+
+itest!(run_existing_npm_package_with_subpath {
+ args:
+ "run --allow-read --node-modules-dir npm:@denotest/bin/cli-esm dev --help",
+ output: "npm/run_existing_npm_package_with_subpath/main.out",
+ envs: env_vars_for_npm_tests(),
+ http_server: true,
+ temp_cwd: true,
+ cwd: Some("npm/run_existing_npm_package_with_subpath/"),
+ copy_temp_dir: Some("npm/run_existing_npm_package_with_subpath/"),
+});
+
#[test]
fn parallel_downloading() {
let (out, _err) = util::run_and_collect_output_with_args(
diff --git a/cli/tests/testdata/npm/registry/@denotest/bin/0.5.0/package.json b/cli/tests/testdata/npm/registry/@denotest/bin/0.5.0/package.json
index caa2ef538..1b077a52e 100644
--- a/cli/tests/testdata/npm/registry/@denotest/bin/0.5.0/package.json
+++ b/cli/tests/testdata/npm/registry/@denotest/bin/0.5.0/package.json
@@ -1,5 +1,5 @@
{
- "name": "@deno/bin",
+ "name": "@denotest/bin",
"version": "0.5.0",
"bin": "./cli.mjs"
}
diff --git a/cli/tests/testdata/npm/registry/@denotest/bin/0.6.0/package.json b/cli/tests/testdata/npm/registry/@denotest/bin/0.6.0/package.json
index db50464bc..a9ff2d946 100644
--- a/cli/tests/testdata/npm/registry/@denotest/bin/0.6.0/package.json
+++ b/cli/tests/testdata/npm/registry/@denotest/bin/0.6.0/package.json
@@ -1,4 +1,4 @@
{
- "name": "@deno/bin",
+ "name": "@denotest/bin",
"version": "0.6.0"
}
diff --git a/cli/tests/testdata/npm/registry/@denotest/bin/1.0.0/package.json b/cli/tests/testdata/npm/registry/@denotest/bin/1.0.0/package.json
index 78a1abff2..27118c21a 100644
--- a/cli/tests/testdata/npm/registry/@denotest/bin/1.0.0/package.json
+++ b/cli/tests/testdata/npm/registry/@denotest/bin/1.0.0/package.json
@@ -1,5 +1,5 @@
{
- "name": "@deno/bin",
+ "name": "@denotest/bin",
"version": "1.0.0",
"bin": {
"cli-esm": "./cli.mjs",
diff --git a/cli/tests/testdata/npm/run_existing_npm_package/main.out b/cli/tests/testdata/npm/run_existing_npm_package/main.out
new file mode 100644
index 000000000..baf7b7afd
--- /dev/null
+++ b/cli/tests/testdata/npm/run_existing_npm_package/main.out
@@ -0,0 +1,3 @@
+Download http://localhost:4545/npm/registry/@denotest/bin
+Download http://localhost:4545/npm/registry/@denotest/bin/0.5.0.tgz
+Initialize @denotest/bin@0.5.0
diff --git a/cli/tests/testdata/npm/run_existing_npm_package/package.json b/cli/tests/testdata/npm/run_existing_npm_package/package.json
new file mode 100644
index 000000000..1cd6d749d
--- /dev/null
+++ b/cli/tests/testdata/npm/run_existing_npm_package/package.json
@@ -0,0 +1,6 @@
+{
+ "name": "run-existing-npm-package",
+ "dependencies": {
+ "@denotest/bin": "0.5.0"
+ }
+}
diff --git a/cli/tests/testdata/npm/run_existing_npm_package_with_subpath/main.out b/cli/tests/testdata/npm/run_existing_npm_package_with_subpath/main.out
new file mode 100644
index 000000000..bec78df94
--- /dev/null
+++ b/cli/tests/testdata/npm/run_existing_npm_package_with_subpath/main.out
@@ -0,0 +1,5 @@
+Download http://localhost:4545/npm/registry/@denotest/bin
+Download http://localhost:4545/npm/registry/@denotest/bin/1.0.0.tgz
+Initialize @denotest/bin@1.0.0
+dev
+--help
diff --git a/cli/tests/testdata/npm/run_existing_npm_package_with_subpath/package.json b/cli/tests/testdata/npm/run_existing_npm_package_with_subpath/package.json
new file mode 100644
index 000000000..e9a7e84ce
--- /dev/null
+++ b/cli/tests/testdata/npm/run_existing_npm_package_with_subpath/package.json
@@ -0,0 +1,6 @@
+{
+ "name": "run-existing-npm-package",
+ "dependencies": {
+ "@denotest/bin": "1.0.0"
+ }
+}