summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/registry/jsr/@denotest/type-only-import/1.0.0/foo.ts3
-rw-r--r--tests/registry/jsr/@denotest/type-only-import/1.0.0/mod.ts3
-rw-r--r--tests/registry/jsr/@denotest/type-only-import/1.0.0_meta.json5
-rw-r--r--tests/registry/jsr/@denotest/type-only-import/meta.json5
-rw-r--r--tests/specs/install/type_only_import/__test__.jsonc10
-rw-r--r--tests/specs/install/type_only_import/install.out6
-rw-r--r--tests/specs/install/type_only_import/main.ts3
-rw-r--r--tests/specs/install/type_only_import/run.out2
8 files changed, 37 insertions, 0 deletions
diff --git a/tests/registry/jsr/@denotest/type-only-import/1.0.0/foo.ts b/tests/registry/jsr/@denotest/type-only-import/1.0.0/foo.ts
new file mode 100644
index 000000000..4e09512c0
--- /dev/null
+++ b/tests/registry/jsr/@denotest/type-only-import/1.0.0/foo.ts
@@ -0,0 +1,3 @@
+export interface Foo {
+ bar: string;
+} \ No newline at end of file
diff --git a/tests/registry/jsr/@denotest/type-only-import/1.0.0/mod.ts b/tests/registry/jsr/@denotest/type-only-import/1.0.0/mod.ts
new file mode 100644
index 000000000..093a57d8a
--- /dev/null
+++ b/tests/registry/jsr/@denotest/type-only-import/1.0.0/mod.ts
@@ -0,0 +1,3 @@
+import type { Foo } from "./foo.ts";
+
+export const foo: Foo = { bar: "foo" }; \ No newline at end of file
diff --git a/tests/registry/jsr/@denotest/type-only-import/1.0.0_meta.json b/tests/registry/jsr/@denotest/type-only-import/1.0.0_meta.json
new file mode 100644
index 000000000..631a18d0e
--- /dev/null
+++ b/tests/registry/jsr/@denotest/type-only-import/1.0.0_meta.json
@@ -0,0 +1,5 @@
+{
+ "exports": {
+ ".": "./mod.ts"
+ }
+}
diff --git a/tests/registry/jsr/@denotest/type-only-import/meta.json b/tests/registry/jsr/@denotest/type-only-import/meta.json
new file mode 100644
index 000000000..02601e4d0
--- /dev/null
+++ b/tests/registry/jsr/@denotest/type-only-import/meta.json
@@ -0,0 +1,5 @@
+{
+ "versions": {
+ "1.0.0": {}
+ }
+}
diff --git a/tests/specs/install/type_only_import/__test__.jsonc b/tests/specs/install/type_only_import/__test__.jsonc
new file mode 100644
index 000000000..22b8134ac
--- /dev/null
+++ b/tests/specs/install/type_only_import/__test__.jsonc
@@ -0,0 +1,10 @@
+{
+ "tempDir": true,
+ "steps": [
+ { "args": "install -e main.ts", "output": "install.out" },
+ {
+ "args": "run --check --cached-only main.ts",
+ "output": "run.out"
+ }
+ ]
+}
diff --git a/tests/specs/install/type_only_import/install.out b/tests/specs/install/type_only_import/install.out
new file mode 100644
index 000000000..1bdbec4e5
--- /dev/null
+++ b/tests/specs/install/type_only_import/install.out
@@ -0,0 +1,6 @@
+Download http://127.0.0.1:4250/@denotest/type-only-import/meta.json
+Download http://127.0.0.1:4250/@denotest/type-only-import/1.0.0_meta.json
+[UNORDERED_START]
+Download http://127.0.0.1:4250/@denotest/type-only-import/1.0.0/mod.ts
+Download http://127.0.0.1:4250/@denotest/type-only-import/1.0.0/foo.ts
+[UNORDERED_END]
diff --git a/tests/specs/install/type_only_import/main.ts b/tests/specs/install/type_only_import/main.ts
new file mode 100644
index 000000000..bf22935a2
--- /dev/null
+++ b/tests/specs/install/type_only_import/main.ts
@@ -0,0 +1,3 @@
+import { foo } from "jsr:@denotest/type-only-import";
+
+console.log(foo.bar);
diff --git a/tests/specs/install/type_only_import/run.out b/tests/specs/install/type_only_import/run.out
new file mode 100644
index 000000000..d36ac8aa3
--- /dev/null
+++ b/tests/specs/install/type_only_import/run.out
@@ -0,0 +1,2 @@
+Check [WILDCARD]main.ts
+foo