summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/npm_tests.rs8
-rw-r--r--cli/tests/testdata/npm/registry/@denotest/types-exports-import-types/1.0.0/dist/main.d.ts1
-rw-r--r--cli/tests/testdata/npm/registry/@denotest/types-exports-import-types/1.0.0/dist/main.mjs3
-rw-r--r--cli/tests/testdata/npm/registry/@denotest/types-exports-import-types/1.0.0/package.json10
-rw-r--r--cli/tests/testdata/npm/types_exports_import_types/main.out4
-rw-r--r--cli/tests/testdata/npm/types_exports_import_types/main.ts4
6 files changed, 30 insertions, 0 deletions
diff --git a/cli/tests/npm_tests.rs b/cli/tests/npm_tests.rs
index c845f8f4a..39dd1d549 100644
--- a/cli/tests/npm_tests.rs
+++ b/cli/tests/npm_tests.rs
@@ -327,6 +327,14 @@ mod npm {
exit_code: 0,
});
+ itest!(types_exports_import_types {
+ args: "run --check=all npm/types_exports_import_types/main.ts",
+ output: "npm/types_exports_import_types/main.out",
+ envs: env_vars_for_npm_tests(),
+ http_server: true,
+ exit_code: 0,
+ });
+
itest!(types_no_types_entry {
args: "run --check=all npm/types_no_types_entry/main.ts",
output: "npm/types_no_types_entry/main.out",
diff --git a/cli/tests/testdata/npm/registry/@denotest/types-exports-import-types/1.0.0/dist/main.d.ts b/cli/tests/testdata/npm/registry/@denotest/types-exports-import-types/1.0.0/dist/main.d.ts
new file mode 100644
index 000000000..2341a14f0
--- /dev/null
+++ b/cli/tests/testdata/npm/registry/@denotest/types-exports-import-types/1.0.0/dist/main.d.ts
@@ -0,0 +1 @@
+export function getValue(): 5;
diff --git a/cli/tests/testdata/npm/registry/@denotest/types-exports-import-types/1.0.0/dist/main.mjs b/cli/tests/testdata/npm/registry/@denotest/types-exports-import-types/1.0.0/dist/main.mjs
new file mode 100644
index 000000000..358b4b09e
--- /dev/null
+++ b/cli/tests/testdata/npm/registry/@denotest/types-exports-import-types/1.0.0/dist/main.mjs
@@ -0,0 +1,3 @@
+export function getValue() {
+ return 5;
+}
diff --git a/cli/tests/testdata/npm/registry/@denotest/types-exports-import-types/1.0.0/package.json b/cli/tests/testdata/npm/registry/@denotest/types-exports-import-types/1.0.0/package.json
new file mode 100644
index 000000000..202a2c784
--- /dev/null
+++ b/cli/tests/testdata/npm/registry/@denotest/types-exports-import-types/1.0.0/package.json
@@ -0,0 +1,10 @@
+{
+ "name": "@denotest/types-exports-import-types",
+ "version": "1.0.0",
+ "exports": {
+ "node": {
+ "types": "./dist/main.d.ts",
+ "import": "./dist/main.mjs"
+ }
+ }
+}
diff --git a/cli/tests/testdata/npm/types_exports_import_types/main.out b/cli/tests/testdata/npm/types_exports_import_types/main.out
new file mode 100644
index 000000000..6f6cb8366
--- /dev/null
+++ b/cli/tests/testdata/npm/types_exports_import_types/main.out
@@ -0,0 +1,4 @@
+Download http://localhost:4545/npm/registry/@denotest/types-exports-import-types
+Download http://localhost:4545/npm/registry/@denotest/types-exports-import-types/1.0.0.tgz
+Check file://[WILDCARD]/types_exports_import_types/main.ts
+5
diff --git a/cli/tests/testdata/npm/types_exports_import_types/main.ts b/cli/tests/testdata/npm/types_exports_import_types/main.ts
new file mode 100644
index 000000000..00b69c438
--- /dev/null
+++ b/cli/tests/testdata/npm/types_exports_import_types/main.ts
@@ -0,0 +1,4 @@
+import { getValue } from "npm:@denotest/types-exports-import-types";
+
+const result: 5 = getValue();
+console.log(result);