summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-02-23 12:33:23 -0500
committerGitHub <noreply@github.com>2023-02-23 17:33:23 +0000
commit6233c0aff0dc9e58b02dfc9499048385bbf836c6 (patch)
treeb6f09c73bbaca669e22b5f5c6f30961a87f78be5 /cli/tests
parent344317ec501fa124f0c74b44035fa4516999dce6 (diff)
fix(npm): support bare specifiers in package.json having a path (#17903)
For example `import * as test from "package/path.js"`
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/testdata/npm/node_modules_import/main.out1
-rw-r--r--cli/tests/testdata/npm/node_modules_import/main.ts7
-rw-r--r--cli/tests/testdata/npm/node_modules_import/main_check.out11
3 files changed, 14 insertions, 5 deletions
diff --git a/cli/tests/testdata/npm/node_modules_import/main.out b/cli/tests/testdata/npm/node_modules_import/main.out
index 51993f072..083edaac2 100644
--- a/cli/tests/testdata/npm/node_modules_import/main.out
+++ b/cli/tests/testdata/npm/node_modules_import/main.out
@@ -1,2 +1,3 @@
2
2
+2
diff --git a/cli/tests/testdata/npm/node_modules_import/main.ts b/cli/tests/testdata/npm/node_modules_import/main.ts
index ed433ed04..848ca0f81 100644
--- a/cli/tests/testdata/npm/node_modules_import/main.ts
+++ b/cli/tests/testdata/npm/node_modules_import/main.ts
@@ -1,13 +1,16 @@
import * as myImport1 from "@denotest/esm-basic";
import * as myImport2 from "./node_modules/@denotest/esm-basic/main.mjs";
+import * as myImport3 from "@denotest/esm-basic/main.mjs";
myImport1.setValue(5);
myImport2.setValue(2);
-// these should both give type errors
+// these should all give type errors
const value1: string = myImport1.getValue();
const value2: string = myImport2.getValue();
+const value3: string = myImport3.getValue();
-// these should both be equal because it should be mutating the same module
+// these should all be equal because it should be mutating the same module
console.log(value1);
console.log(value2);
+console.log(value3);
diff --git a/cli/tests/testdata/npm/node_modules_import/main_check.out b/cli/tests/testdata/npm/node_modules_import/main_check.out
index 4442a97ba..cf7cc110d 100644
--- a/cli/tests/testdata/npm/node_modules_import/main_check.out
+++ b/cli/tests/testdata/npm/node_modules_import/main_check.out
@@ -1,11 +1,16 @@
error: TS2322 [ERROR]: Type 'number' is not assignable to type 'string'.
const value1: string = myImport1.getValue();
~~~~~~
- at file:///[WILDCARD]/npm/node_modules_import/main.ts:8:7
+ at file:///[WILDCARD]/npm/node_modules_import/main.ts:9:7
TS2322 [ERROR]: Type 'number' is not assignable to type 'string'.
const value2: string = myImport2.getValue();
~~~~~~
- at file:///[WILDCARD]/npm/node_modules_import/main.ts:9:7
+ at file:///[WILDCARD]/npm/node_modules_import/main.ts:10:7
+
+TS2322 [ERROR]: Type 'number' is not assignable to type 'string'.
+const value3: string = myImport3.getValue();
+ ~~~~~~
+ at file:///[WILDCARD]/npm/node_modules_import/main.ts:11:7
-Found 2 errors.
+Found 3 errors.