summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/specs/jsr/excluded_export_module/__test__.jsonc7
-rw-r--r--tests/specs/jsr/excluded_export_module/deno.json12
-rw-r--r--tests/specs/jsr/excluded_export_module/excluded_file1.ts0
-rw-r--r--tests/specs/jsr/excluded_export_module/excluded_file2.ts0
-rw-r--r--tests/specs/jsr/excluded_export_module/main.ts2
-rw-r--r--tests/specs/jsr/excluded_export_module/not_imported_excluded_file.ts0
-rw-r--r--tests/specs/jsr/excluded_export_module/publish.out18
7 files changed, 39 insertions, 0 deletions
diff --git a/tests/specs/jsr/excluded_export_module/__test__.jsonc b/tests/specs/jsr/excluded_export_module/__test__.jsonc
new file mode 100644
index 000000000..2ff51f507
--- /dev/null
+++ b/tests/specs/jsr/excluded_export_module/__test__.jsonc
@@ -0,0 +1,7 @@
+// test for a module that's excluded from being
+// published, but is found in the module graph
+{
+ "args": "publish --dry-run",
+ "output": "publish.out",
+ "exitCode": 1
+}
diff --git a/tests/specs/jsr/excluded_export_module/deno.json b/tests/specs/jsr/excluded_export_module/deno.json
new file mode 100644
index 000000000..1254582ac
--- /dev/null
+++ b/tests/specs/jsr/excluded_export_module/deno.json
@@ -0,0 +1,12 @@
+{
+ "name": "@denotest/excluded-export-module",
+ "version": "0.1.0",
+ "exports": "./main.ts",
+ "publish": {
+ "exclude": [
+ "./excluded_file1.ts",
+ "./excluded_file2.ts",
+ "./not_imported_excluded_file.ts"
+ ]
+ }
+}
diff --git a/tests/specs/jsr/excluded_export_module/excluded_file1.ts b/tests/specs/jsr/excluded_export_module/excluded_file1.ts
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/specs/jsr/excluded_export_module/excluded_file1.ts
diff --git a/tests/specs/jsr/excluded_export_module/excluded_file2.ts b/tests/specs/jsr/excluded_export_module/excluded_file2.ts
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/specs/jsr/excluded_export_module/excluded_file2.ts
diff --git a/tests/specs/jsr/excluded_export_module/main.ts b/tests/specs/jsr/excluded_export_module/main.ts
new file mode 100644
index 000000000..69bff30bf
--- /dev/null
+++ b/tests/specs/jsr/excluded_export_module/main.ts
@@ -0,0 +1,2 @@
+import "./excluded_file1.ts";
+import "./excluded_file2.ts";
diff --git a/tests/specs/jsr/excluded_export_module/not_imported_excluded_file.ts b/tests/specs/jsr/excluded_export_module/not_imported_excluded_file.ts
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/specs/jsr/excluded_export_module/not_imported_excluded_file.ts
diff --git a/tests/specs/jsr/excluded_export_module/publish.out b/tests/specs/jsr/excluded_export_module/publish.out
new file mode 100644
index 000000000..bcf94e521
--- /dev/null
+++ b/tests/specs/jsr/excluded_export_module/publish.out
@@ -0,0 +1,18 @@
+Check file:///[WILDLINE]/main.ts
+Checking for slow types in the public API...
+Check file:///[WILDLINE]/main.ts
+error[excluded-module]: module in package's module graph was excluded from publishing
+ --> [WILDLINE]excluded_file1.ts
+ = hint: remove the module from 'exclude' and/or 'publish.exclude' in the config file
+
+ info: excluded modules referenced via a package export will error at runtime due to not existing in the package
+ docs: https://jsr.io/go/excluded-module
+
+error[excluded-module]: module in package's module graph was excluded from publishing
+ --> [WILDLINE]excluded_file2.ts
+ = hint: remove the module from 'exclude' and/or 'publish.exclude' in the config file
+
+ info: excluded modules referenced via a package export will error at runtime due to not existing in the package
+ docs: https://jsr.io/go/excluded-module
+
+error: Found 2 problems