summaryrefslogtreecommitdiff
path: root/tests/specs
diff options
context:
space:
mode:
authorNathan Whitaker <17734409+nathanwhit@users.noreply.github.com>2024-11-04 18:45:00 -0800
committerGitHub <noreply@github.com>2024-11-05 02:45:00 +0000
commit706b1dfcea8ab6bf7d155893ab795669107516a8 (patch)
tree34d176aeb6baa3dd4794d3f2c325720196fbca02 /tests/specs
parent44eca0505c35201c6b67ba073834402b7681914f (diff)
fix(add): better error message when adding package that only has pre-release versions (#26724)
Fixes https://github.com/denoland/deno/issues/26597 A small refactor as well to reduce some code duplication
Diffstat (limited to 'tests/specs')
-rw-r--r--tests/specs/add/only_unstable_versions/__test__.jsonc23
-rw-r--r--tests/specs/add/only_unstable_versions/add_jsr.out1
2 files changed, 19 insertions, 5 deletions
diff --git a/tests/specs/add/only_unstable_versions/__test__.jsonc b/tests/specs/add/only_unstable_versions/__test__.jsonc
index d05628b6f..ea5a270b9 100644
--- a/tests/specs/add/only_unstable_versions/__test__.jsonc
+++ b/tests/specs/add/only_unstable_versions/__test__.jsonc
@@ -1,9 +1,22 @@
{
"tempDir": true,
- "steps": [
- {
- "args": "add npm:@denotest/unstable",
- "output": "add.out"
+ "tests": {
+ "npm_package": {
+ "steps": [
+ {
+ "args": "add npm:@denotest/unstable",
+ "output": "add.out"
+ }
+ ]
+ },
+ "jsr_package": {
+ "steps": [
+ {
+ "args": "add jsr:@denotest/unstable",
+ "output": "add_jsr.out",
+ "exitCode": 1
+ }
+ ]
}
- ]
+ }
}
diff --git a/tests/specs/add/only_unstable_versions/add_jsr.out b/tests/specs/add/only_unstable_versions/add_jsr.out
new file mode 100644
index 000000000..95f0630bf
--- /dev/null
+++ b/tests/specs/add/only_unstable_versions/add_jsr.out
@@ -0,0 +1 @@
+error: jsr:@denotest/unstable has only pre-release versions available. Try specifying a version: `deno add jsr:@denotest/unstable@^1.0.0-beta.2`