summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/integration/npm_tests.rs8
-rw-r--r--cli/tests/testdata/npm/compare_globals/main.out1
-rw-r--r--cli/tests/testdata/npm/esm/test.out1
-rw-r--r--cli/tests/testdata/npm/no_types_in_conditional_exports/main.out1
-rw-r--r--cli/tests/testdata/npm/registry/@denotest/types-entry-value-not-exists/1.0.0/dist/main.d.ts1
-rw-r--r--cli/tests/testdata/npm/registry/@denotest/types-entry-value-not-exists/1.0.0/dist/main.js1
-rw-r--r--cli/tests/testdata/npm/registry/@denotest/types-entry-value-not-exists/1.0.0/package.json13
-rw-r--r--cli/tests/testdata/npm/types_entry_value_not_exists/main.out4
-rw-r--r--cli/tests/testdata/npm/types_entry_value_not_exists/main.ts4
9 files changed, 31 insertions, 3 deletions
diff --git a/cli/tests/integration/npm_tests.rs b/cli/tests/integration/npm_tests.rs
index fb79a1cb0..afd023c85 100644
--- a/cli/tests/integration/npm_tests.rs
+++ b/cli/tests/integration/npm_tests.rs
@@ -298,6 +298,14 @@ itest!(no_types_in_conditional_exports {
http_server: true,
});
+itest!(types_entry_value_not_exists {
+ args: "run --check=all npm/types_entry_value_not_exists/main.ts",
+ output: "npm/types_entry_value_not_exists/main.out",
+ envs: env_vars(),
+ http_server: true,
+ exit_code: 0,
+});
+
#[test]
fn parallel_downloading() {
let (out, _err) = util::run_and_collect_output_with_args(
diff --git a/cli/tests/testdata/npm/compare_globals/main.out b/cli/tests/testdata/npm/compare_globals/main.out
index 1b22fd318..8b3b62bc1 100644
--- a/cli/tests/testdata/npm/compare_globals/main.out
+++ b/cli/tests/testdata/npm/compare_globals/main.out
@@ -3,6 +3,5 @@ Download http://localhost:4545/npm/registry/@types/node
Download http://localhost:4545/npm/registry/@denotest/globals/1.0.0.tgz
Download http://localhost:4545/npm/registry/@types/node/node-18.8.2.tgz
Check file:///[WILDCARD]/npm/compare_globals/main.ts
-Check file:///[WILDCARD]/std/node/module_all.ts
true
[]
diff --git a/cli/tests/testdata/npm/esm/test.out b/cli/tests/testdata/npm/esm/test.out
index b3115e79f..cc196501d 100644
--- a/cli/tests/testdata/npm/esm/test.out
+++ b/cli/tests/testdata/npm/esm/test.out
@@ -1,6 +1,5 @@
Download http://localhost:4545/npm/registry/chalk
Download http://localhost:4545/npm/registry/chalk/chalk-5.0.1.tgz
-Check [WILDCARD]/std/node/module_all.ts
running 1 test from ./npm/esm/test.js
test ...
------- output -------
diff --git a/cli/tests/testdata/npm/no_types_in_conditional_exports/main.out b/cli/tests/testdata/npm/no_types_in_conditional_exports/main.out
index 7d574aed2..3c856ac09 100644
--- a/cli/tests/testdata/npm/no_types_in_conditional_exports/main.out
+++ b/cli/tests/testdata/npm/no_types_in_conditional_exports/main.out
@@ -1,5 +1,4 @@
Download http://localhost:4545/npm/registry/@denotest/no-types-in-conditional-exports
Download http://localhost:4545/npm/registry/@denotest/no-types-in-conditional-exports/1.0.0.tgz
Check [WILDCARD]npm/no_types_in_conditional_exports/main.ts
-[WILDCARD]
{ foo: "bar" }
diff --git a/cli/tests/testdata/npm/registry/@denotest/types-entry-value-not-exists/1.0.0/dist/main.d.ts b/cli/tests/testdata/npm/registry/@denotest/types-entry-value-not-exists/1.0.0/dist/main.d.ts
new file mode 100644
index 000000000..2341a14f0
--- /dev/null
+++ b/cli/tests/testdata/npm/registry/@denotest/types-entry-value-not-exists/1.0.0/dist/main.d.ts
@@ -0,0 +1 @@
+export function getValue(): 5;
diff --git a/cli/tests/testdata/npm/registry/@denotest/types-entry-value-not-exists/1.0.0/dist/main.js b/cli/tests/testdata/npm/registry/@denotest/types-entry-value-not-exists/1.0.0/dist/main.js
new file mode 100644
index 000000000..d0c5dbc70
--- /dev/null
+++ b/cli/tests/testdata/npm/registry/@denotest/types-entry-value-not-exists/1.0.0/dist/main.js
@@ -0,0 +1 @@
+module.exports.getValue = () => 5;
diff --git a/cli/tests/testdata/npm/registry/@denotest/types-entry-value-not-exists/1.0.0/package.json b/cli/tests/testdata/npm/registry/@denotest/types-entry-value-not-exists/1.0.0/package.json
new file mode 100644
index 000000000..5eb859c4e
--- /dev/null
+++ b/cli/tests/testdata/npm/registry/@denotest/types-entry-value-not-exists/1.0.0/package.json
@@ -0,0 +1,13 @@
+{
+ "name": "@denotest/types-entry-value-not-exists",
+ "version": "1.0.0",
+ "main": "./dist/main.js",
+ "types": "./index.d.ts",
+ "exports": {
+ ".": {
+ "types": "./dist/main.d.ts",
+ "node": "./dist/main.js",
+ "require": "./dist/main.js"
+ }
+ }
+}
diff --git a/cli/tests/testdata/npm/types_entry_value_not_exists/main.out b/cli/tests/testdata/npm/types_entry_value_not_exists/main.out
new file mode 100644
index 000000000..036857827
--- /dev/null
+++ b/cli/tests/testdata/npm/types_entry_value_not_exists/main.out
@@ -0,0 +1,4 @@
+Download http://localhost:4545/npm/registry/@denotest/types-entry-value-not-exists
+Download http://localhost:4545/npm/registry/@denotest/types-entry-value-not-exists/1.0.0.tgz
+Check file://[WILDCARD]/types_entry_value_not_exists/main.ts
+5
diff --git a/cli/tests/testdata/npm/types_entry_value_not_exists/main.ts b/cli/tests/testdata/npm/types_entry_value_not_exists/main.ts
new file mode 100644
index 000000000..d8fca712c
--- /dev/null
+++ b/cli/tests/testdata/npm/types_entry_value_not_exists/main.ts
@@ -0,0 +1,4 @@
+import { getValue } from "npm:@denotest/types-entry-value-not-exists";
+
+const result: 5 = getValue();
+console.log(result);