diff options
author | Asher Gomez <ashersaupingomez@gmail.com> | 2024-04-18 09:46:33 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-17 23:46:33 +0000 |
commit | 25a80bc523bf47d5eba8d578b9ffeba26a8d0341 (patch) | |
tree | 96880afb6427f22fef2fd4bf86b6ec2d96c2a5f6 /tests | |
parent | 24fa5c784a7a4731ba8864e52977857959c580ed (diff) |
test(publish): check specifiers outside fast check module graph (#23369)
Closes #23023
Diffstat (limited to 'tests')
6 files changed, 38 insertions, 0 deletions
diff --git a/tests/specs/publish/prefer_fast_check_graph/__test__.jsonc b/tests/specs/publish/prefer_fast_check_graph/__test__.jsonc new file mode 100644 index 000000000..4aa5a62d0 --- /dev/null +++ b/tests/specs/publish/prefer_fast_check_graph/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "publish --dry-run", + "output": "main.out", + "exitCode": 1 +} diff --git a/tests/specs/publish/prefer_fast_check_graph/deno.json b/tests/specs/publish/prefer_fast_check_graph/deno.json new file mode 100644 index 000000000..e022b2d1b --- /dev/null +++ b/tests/specs/publish/prefer_fast_check_graph/deno.json @@ -0,0 +1,5 @@ +{ + "name": "@example/foo", + "version": "1.0.0", + "exports": "./mod.ts" +} diff --git a/tests/specs/publish/prefer_fast_check_graph/deps.ts b/tests/specs/publish/prefer_fast_check_graph/deps.ts new file mode 100644 index 000000000..5fd04621c --- /dev/null +++ b/tests/specs/publish/prefer_fast_check_graph/deps.ts @@ -0,0 +1 @@ +export * from "https://deno.land/std/assert/assert.ts"; diff --git a/tests/specs/publish/prefer_fast_check_graph/main.out b/tests/specs/publish/prefer_fast_check_graph/main.out new file mode 100644 index 000000000..a68fac83a --- /dev/null +++ b/tests/specs/publish/prefer_fast_check_graph/main.out @@ -0,0 +1,17 @@ +[WILDCARD] +Check [WILDLINE]/tests/specs/publish/prefer_fast_check_graph/mod.ts +Checking for slow types in the public API... +Check [WILDLINE]/tests/specs/publish/prefer_fast_check_graph/mod.ts +error[invalid-external-import]: invalid import to a non-JSR 'https' specifier + --> [WILDLINE]deps.ts:1:15 + | +1 | export * from "https://deno.land/std/assert/assert.ts"; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the specifier + = hint: replace this import with one from jsr or npm, or vendor the dependency into your package + + info: the import was resolved to 'https://deno.land/std/assert/assert.ts' + info: this specifier is not allowed to be imported on jsr + info: jsr only supports importing `jsr:`, `npm:`, and `data:` specifiers + docs: https://jsr.io/go/invalid-external-import + +error: Found 1 problem diff --git a/tests/specs/publish/prefer_fast_check_graph/mod.ts b/tests/specs/publish/prefer_fast_check_graph/mod.ts new file mode 100644 index 000000000..195730f3e --- /dev/null +++ b/tests/specs/publish/prefer_fast_check_graph/mod.ts @@ -0,0 +1,5 @@ +export * from "./subtract.ts"; + +export function add(a: number, b: number): number { + return a + b; +} diff --git a/tests/specs/publish/prefer_fast_check_graph/subtract.ts b/tests/specs/publish/prefer_fast_check_graph/subtract.ts new file mode 100644 index 000000000..a127ebea9 --- /dev/null +++ b/tests/specs/publish/prefer_fast_check_graph/subtract.ts @@ -0,0 +1,5 @@ +import * as blah from "./deps.ts"; + +export function subtract(a: number, b: number): number { + return a - b; +} |