Skip to content

Commit

Permalink
test(publish): check specifiers outside fast check module graph (deno…
Browse files Browse the repository at this point in the history
  • Loading branch information
iuioiua authored Apr 17, 2024
1 parent 24fa5c7 commit 25a80bc
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/specs/publish/prefer_fast_check_graph/__test__.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"args": "publish --dry-run",
"output": "main.out",
"exitCode": 1
}
5 changes: 5 additions & 0 deletions tests/specs/publish/prefer_fast_check_graph/deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "@example/foo",
"version": "1.0.0",
"exports": "./mod.ts"
}
1 change: 1 addition & 0 deletions tests/specs/publish/prefer_fast_check_graph/deps.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "https://deno.land/std/assert/assert.ts";
17 changes: 17 additions & 0 deletions tests/specs/publish/prefer_fast_check_graph/main.out
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions tests/specs/publish/prefer_fast_check_graph/mod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export * from "./subtract.ts";

export function add(a: number, b: number): number {
return a + b;
}
5 changes: 5 additions & 0 deletions tests/specs/publish/prefer_fast_check_graph/subtract.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import * as blah from "./deps.ts";

export function subtract(a: number, b: number): number {
return a - b;
}

0 comments on commit 25a80bc

Please sign in to comment.