summaryrefslogtreecommitdiff
path: root/tests/specs/publish/missing_constraint
diff options
context:
space:
mode:
Diffstat (limited to 'tests/specs/publish/missing_constraint')
-rw-r--r--tests/specs/publish/missing_constraint/__test__.jsonc5
-rw-r--r--tests/specs/publish/missing_constraint/deno.json9
-rw-r--r--tests/specs/publish/missing_constraint/mod.ts7
-rw-r--r--tests/specs/publish/missing_constraint/publish.out37
4 files changed, 58 insertions, 0 deletions
diff --git a/tests/specs/publish/missing_constraint/__test__.jsonc b/tests/specs/publish/missing_constraint/__test__.jsonc
new file mode 100644
index 000000000..06a91f5b6
--- /dev/null
+++ b/tests/specs/publish/missing_constraint/__test__.jsonc
@@ -0,0 +1,5 @@
+{
+ "args": "publish --dry-run",
+ "output": "publish.out",
+ "exitCode": 1
+}
diff --git a/tests/specs/publish/missing_constraint/deno.json b/tests/specs/publish/missing_constraint/deno.json
new file mode 100644
index 000000000..89f6db90c
--- /dev/null
+++ b/tests/specs/publish/missing_constraint/deno.json
@@ -0,0 +1,9 @@
+{
+ "name": "@scope/pkg",
+ "version": "1.0.0",
+ "exports": "./mod.ts",
+ "imports": {
+ "basic": "npm:@denotest/esm-basic",
+ "add": "jsr:@denotest/add"
+ }
+}
diff --git a/tests/specs/publish/missing_constraint/mod.ts b/tests/specs/publish/missing_constraint/mod.ts
new file mode 100644
index 000000000..59e40d241
--- /dev/null
+++ b/tests/specs/publish/missing_constraint/mod.ts
@@ -0,0 +1,7 @@
+import { add } from "add";
+import * as basic from "basic";
+import * as deps from "jsr:@denotest/deps";
+
+console.log(add(1, 2));
+console.log(deps);
+console.log(basic);
diff --git a/tests/specs/publish/missing_constraint/publish.out b/tests/specs/publish/missing_constraint/publish.out
new file mode 100644
index 000000000..846612979
--- /dev/null
+++ b/tests/specs/publish/missing_constraint/publish.out
@@ -0,0 +1,37 @@
+[WILDCARD]
+Checking for slow types in the public API...
+Check file:///[WILDLINE]/mod.ts
+error[missing-constraint]: specifier 'jsr:@denotest/add' is missing a version constraint
+ --> [WILDLINE]mod.ts:[WILDLINE]
+ |
+1 | import { add } from "add";
+ | ^^^^^ the specifier
+ = hint: specify a version constraint for the specifier in the import map
+
+ info: the specifier resolved to version 1.0.0 today, but will resolve to a different
+ info: major version if one is published in the future and potentially break
+ docs: https://jsr.io/go/missing-constraint
+
+error[missing-constraint]: specifier 'npm:@denotest/esm-basic' is missing a version constraint
+ --> [WILDLINE]mod.ts:[WILDLINE]
+ |
+2 | import * as basic from "basic";
+ | ^^^^^^^ the specifier
+ = hint: specify a version constraint for the specifier in the import map
+
+ info: the specifier resolved to version 1.0.0 today, but will resolve to a different
+ info: major version if one is published in the future and potentially break
+ docs: https://jsr.io/go/missing-constraint
+
+error[missing-constraint]: specifier 'jsr:@denotest/deps' is missing a version constraint
+ --> [WILDLINE]mod.ts:[WILDLINE]
+ |
+3 | import * as deps from "jsr:@denotest/deps";
+ | ^^^^^^^^^^^^^^^^^^^^ the specifier
+ = hint: specify a version constraint for the specifier
+
+ info: the specifier resolved to version 1.0.0 today, but will resolve to a different
+ info: major version if one is published in the future and potentially break
+ docs: https://jsr.io/go/missing-constraint
+
+error: Found 3 problems