summaryrefslogtreecommitdiff
path: root/tests/specs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-03-31 16:39:40 -0400
committerGitHub <noreply@github.com>2024-03-31 16:39:40 -0400
commitb8af46e0075f659f4e373e249b0f19b3cb0f62a9 (patch)
tree9a029e81b6d7d4294b729dc5db860b015368b1ba /tests/specs
parent01445940449cedc571dcbd69caa7da58de007f2b (diff)
fix(check): ignore certain diagnostics in remote modules and when publishing (#23119)
Unused locals and parameters don't make sense to surface in remote modules. Additionally, fast check can cause these kind of diagnostics when publishing, so they should be ignored. Closes #22959
Diffstat (limited to 'tests/specs')
-rw-r--r--tests/specs/jsr/no_unused_params/__test__.jsonc10
-rw-r--r--tests/specs/jsr/no_unused_params/deno.json9
-rw-r--r--tests/specs/jsr/no_unused_params/main.out4
-rw-r--r--tests/specs/jsr/no_unused_params/main.ts5
-rw-r--r--tests/specs/jsr/no_unused_params/publish.out10
5 files changed, 38 insertions, 0 deletions
diff --git a/tests/specs/jsr/no_unused_params/__test__.jsonc b/tests/specs/jsr/no_unused_params/__test__.jsonc
new file mode 100644
index 000000000..4192ad5dd
--- /dev/null
+++ b/tests/specs/jsr/no_unused_params/__test__.jsonc
@@ -0,0 +1,10 @@
+{
+ "base": "jsr",
+ "steps": [{
+ "args": "check --all main.ts",
+ "output": "main.out"
+ }, {
+ "args": "publish --dry-run",
+ "output": "publish.out"
+ }]
+}
diff --git a/tests/specs/jsr/no_unused_params/deno.json b/tests/specs/jsr/no_unused_params/deno.json
new file mode 100644
index 000000000..41a02bf40
--- /dev/null
+++ b/tests/specs/jsr/no_unused_params/deno.json
@@ -0,0 +1,9 @@
+{
+ "name": "@scope/package",
+ "version": "0.0.0",
+ "exports": "./main.ts",
+ "lock": false,
+ "compilerOptions": {
+ "noUnusedParameters": true
+ }
+}
diff --git a/tests/specs/jsr/no_unused_params/main.out b/tests/specs/jsr/no_unused_params/main.out
new file mode 100644
index 000000000..7f586ac8b
--- /dev/null
+++ b/tests/specs/jsr/no_unused_params/main.out
@@ -0,0 +1,4 @@
+Download http://127.0.0.1:4250/@denotest/add/meta.json
+Download http://127.0.0.1:4250/@denotest/add/1.0.0_meta.json
+Download http://127.0.0.1:4250/@denotest/add/1.0.0/mod.ts
+Check file:///[WILDLINE]/no_unused_params/main.ts
diff --git a/tests/specs/jsr/no_unused_params/main.ts b/tests/specs/jsr/no_unused_params/main.ts
new file mode 100644
index 000000000..e8b12ca89
--- /dev/null
+++ b/tests/specs/jsr/no_unused_params/main.ts
@@ -0,0 +1,5 @@
+import * as inner from "jsr:@denotest/add";
+
+export function add(a: number, b: number): number {
+ return inner.add(a, b);
+}
diff --git a/tests/specs/jsr/no_unused_params/publish.out b/tests/specs/jsr/no_unused_params/publish.out
new file mode 100644
index 000000000..a8eff6eb3
--- /dev/null
+++ b/tests/specs/jsr/no_unused_params/publish.out
@@ -0,0 +1,10 @@
+Check file:///[WILDLINE]/main.ts
+Checking for slow types in the public API...
+Check file:///[WILDLINE]/main.ts
+Simulating publish of @scope/package@0.0.0 with files:
+ file:///[WILDLINE]/__test__.jsonc ([WILDLINE])
+ file:///[WILDLINE]/deno.json ([WILDLINE])
+ file:///[WILDLINE]/main.out ([WILDLINE])
+ file:///[WILDLINE]/main.ts ([WILDLINE])
+ file:///[WILDLINE]/publish.out ([WILDLINE])
+Warning Aborting due to --dry-run