summaryrefslogtreecommitdiff
path: root/cli/tests/testdata/npm
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2022-11-28 17:48:56 -0500
committerGitHub <noreply@github.com>2022-11-28 17:48:56 -0500
commitd3299c2d6c036d3f016ef1abbe9c06e9b1656fd0 (patch)
tree3dfc98c52907465a20fe490b8e648d3180cfc4ba /cli/tests/testdata/npm
parent2d4c46c975eb916dc622cc729a1a8d397582a76f (diff)
fix(npm): don't resolve JS files when resolving types (#16854)
Closes #16851
Diffstat (limited to 'cli/tests/testdata/npm')
-rw-r--r--cli/tests/testdata/npm/no_types_cjs/main.ts7
-rw-r--r--cli/tests/testdata/npm/registry/@denotest/no-types-cjs/1.0.0/main.js6
-rw-r--r--cli/tests/testdata/npm/registry/@denotest/no-types-cjs/1.0.0/package.json5
3 files changed, 18 insertions, 0 deletions
diff --git a/cli/tests/testdata/npm/no_types_cjs/main.ts b/cli/tests/testdata/npm/no_types_cjs/main.ts
new file mode 100644
index 000000000..32458e839
--- /dev/null
+++ b/cli/tests/testdata/npm/no_types_cjs/main.ts
@@ -0,0 +1,7 @@
+import mod from "npm:@denotest/no-types-cjs";
+
+// it actually returns a `number` and has that in its
+// jsdocs, but the jsdocs should not have been resolved so
+// this should type check just fine
+const value: string = mod();
+console.log(value);
diff --git a/cli/tests/testdata/npm/registry/@denotest/no-types-cjs/1.0.0/main.js b/cli/tests/testdata/npm/registry/@denotest/no-types-cjs/1.0.0/main.js
new file mode 100644
index 000000000..bb6cbdb02
--- /dev/null
+++ b/cli/tests/testdata/npm/registry/@denotest/no-types-cjs/1.0.0/main.js
@@ -0,0 +1,6 @@
+/**
+ * @return {number}
+ */
+ module.exports = function () {
+ return 5;
+};
diff --git a/cli/tests/testdata/npm/registry/@denotest/no-types-cjs/1.0.0/package.json b/cli/tests/testdata/npm/registry/@denotest/no-types-cjs/1.0.0/package.json
new file mode 100644
index 000000000..60b8a0285
--- /dev/null
+++ b/cli/tests/testdata/npm/registry/@denotest/no-types-cjs/1.0.0/package.json
@@ -0,0 +1,5 @@
+{
+ "name": "@denotest/no-types-cjs",
+ "version": "1.0.0",
+ "main": "./main.js"
+}