summaryrefslogtreecommitdiff
path: root/tests/specs
diff options
context:
space:
mode:
authorLeo Kettmeir <crowlkats@toaxl.com>2024-09-18 11:38:22 -0700
committerGitHub <noreply@github.com>2024-09-18 20:38:22 +0200
commitec86089c4e95eabbf9edc48491031eb6711a410f (patch)
tree3b441ba1bc9f7f95b6d87b4439cec78176db39c4 /tests/specs
parentc90b07457958518a8830798d8800f647f897d12f (diff)
feat: require jsr prefix for `deno install` and `deno add` (#25698)
Diffstat (limited to 'tests/specs')
-rw-r--r--tests/specs/add/add_with_subpath/__test__.jsonc4
-rw-r--r--tests/specs/add/add_with_subpath/wrong_constraint_jsr.out2
-rw-r--r--tests/specs/add/missing_npm_specifier/__test__.jsonc8
-rw-r--r--tests/specs/add/missing_prefix/__test__.jsonc15
-rw-r--r--tests/specs/add/missing_prefix/deno.json0
-rw-r--r--tests/specs/add/no_root_export/__test__.jsonc2
-rw-r--r--tests/specs/add/package_json_and_deno_json/__test__.jsonc2
-rw-r--r--tests/specs/remove/basic/__test__.jsonc2
8 files changed, 25 insertions, 10 deletions
diff --git a/tests/specs/add/add_with_subpath/__test__.jsonc b/tests/specs/add/add_with_subpath/__test__.jsonc
index b051bd265..edd45299d 100644
--- a/tests/specs/add/add_with_subpath/__test__.jsonc
+++ b/tests/specs/add/add_with_subpath/__test__.jsonc
@@ -2,11 +2,11 @@
"tempDir": true,
"steps": [
{
- "args": "add @std/testing/bdd npm:preact/hooks",
+ "args": "add jsr:@std/testing/bdd npm:preact/hooks",
"output": "add.out"
},
{
- "args": "add @std/testing/bdd@1 npm:preact/hooks@10",
+ "args": "add jsr:@std/testing/bdd@1 npm:preact/hooks@10",
"output": "wrong_constraint_jsr.out",
"exitCode": 1
},
diff --git a/tests/specs/add/add_with_subpath/wrong_constraint_jsr.out b/tests/specs/add/add_with_subpath/wrong_constraint_jsr.out
index 2b218407d..7de7008e9 100644
--- a/tests/specs/add/add_with_subpath/wrong_constraint_jsr.out
+++ b/tests/specs/add/add_with_subpath/wrong_constraint_jsr.out
@@ -1,4 +1,4 @@
-error: Failed to parse package required: @std/testing/bdd@1
+error: Failed to parse package required: jsr:@std/testing/bdd@1
Caused by:
Invalid package specifier 'jsr:@std/testing/bdd@1'. Did you mean to write 'jsr:@std/testing@1/bdd'?
diff --git a/tests/specs/add/missing_npm_specifier/__test__.jsonc b/tests/specs/add/missing_npm_specifier/__test__.jsonc
index 10e109c95..3e3f8df96 100644
--- a/tests/specs/add/missing_npm_specifier/__test__.jsonc
+++ b/tests/specs/add/missing_npm_specifier/__test__.jsonc
@@ -2,22 +2,22 @@
"tempDir": true,
"steps": [
{
- "args": "add ajv@latest",
+ "args": "add jsr:ajv@latest",
"output": "error: jsr:ajv was not found, but a matching npm package exists. Did you mean `deno add npm:ajv@latest`?\n",
"exitCode": 1
},
{
- "args": "add ajv",
+ "args": "add jsr:ajv",
"output": "error: jsr:ajv was not found, but a matching npm package exists. Did you mean `deno add npm:ajv`?\n",
"exitCode": 1
},
{
- "args": "add ajv@8.11.0",
+ "args": "add jsr:ajv@8.11.0",
"output": "error: jsr:ajv was not found, but a matching npm package exists. Did you mean `deno add npm:ajv@8.11.0`?\n",
"exitCode": 1
},
{
- "args": "install ajv@latest",
+ "args": "install jsr:ajv@latest",
"output": "error: jsr:ajv was not found, but a matching npm package exists. Did you mean `deno install npm:ajv@latest`?\n",
"exitCode": 1
}
diff --git a/tests/specs/add/missing_prefix/__test__.jsonc b/tests/specs/add/missing_prefix/__test__.jsonc
new file mode 100644
index 000000000..1c97b7737
--- /dev/null
+++ b/tests/specs/add/missing_prefix/__test__.jsonc
@@ -0,0 +1,15 @@
+{
+ "tempDir": true,
+ "steps": [
+ {
+ "args": "add ajv",
+ "output": "error: ajv is missing a prefix. Did you mean `deno add npm:ajv`?\n",
+ "exitCode": 1
+ },
+ {
+ "args": "add @std/testing",
+ "output": "error: @std/testing is missing a prefix. Did you mean `deno add jsr:@std/testing`?\n",
+ "exitCode": 1
+ }
+ ]
+}
diff --git a/tests/specs/add/missing_prefix/deno.json b/tests/specs/add/missing_prefix/deno.json
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/specs/add/missing_prefix/deno.json
diff --git a/tests/specs/add/no_root_export/__test__.jsonc b/tests/specs/add/no_root_export/__test__.jsonc
index 2adfbd8de..c0fa3b7fd 100644
--- a/tests/specs/add/no_root_export/__test__.jsonc
+++ b/tests/specs/add/no_root_export/__test__.jsonc
@@ -2,7 +2,7 @@
"tempDir": true,
"steps": [
{
- "args": "add @std/testing",
+ "args": "add jsr:@std/testing",
"output": "add.out"
}
]
diff --git a/tests/specs/add/package_json_and_deno_json/__test__.jsonc b/tests/specs/add/package_json_and_deno_json/__test__.jsonc
index 4d886d98b..0beee02d1 100644
--- a/tests/specs/add/package_json_and_deno_json/__test__.jsonc
+++ b/tests/specs/add/package_json_and_deno_json/__test__.jsonc
@@ -4,7 +4,7 @@
"npm_prefers_package_json": {
"steps": [
{
- "args": "add npm:@denotest/esm-basic @denotest/add npm:@denotest/say-hello",
+ "args": "add npm:@denotest/esm-basic jsr:@denotest/add npm:@denotest/say-hello",
"output": "add.out"
},
{
diff --git a/tests/specs/remove/basic/__test__.jsonc b/tests/specs/remove/basic/__test__.jsonc
index 495496b5c..fd74900b4 100644
--- a/tests/specs/remove/basic/__test__.jsonc
+++ b/tests/specs/remove/basic/__test__.jsonc
@@ -1,7 +1,7 @@
{
"tempDir": true,
"steps": [{
- "args": ["add", "@std/assert", "@std/http"],
+ "args": ["add", "jsr:@std/assert", "jsr:@std/http"],
"output": "add.out"
}, {
"args": ["eval", "console.log(Deno.readTextFileSync('deno.lock').trim())"],