summaryrefslogtreecommitdiff
path: root/tests/specs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-03-26 18:52:57 -0400
committerGitHub <noreply@github.com>2024-03-26 18:52:57 -0400
commitac4a5f74b8e56a360e0a0543a6fc45099e13b95a (patch)
tree463796fb830eae41fc039512bb1ce79919195735 /tests/specs
parent6b95c53e48a2622f4f2b6fdfa6c2c26dc30bbba4 (diff)
feat: TypeScript 5.4 (#23086)
Fork PR: https://github.com/denoland/TypeScript/pull/10 Closes #23080
Diffstat (limited to 'tests/specs')
-rw-r--r--tests/specs/check/cjs_default_export/__test__.jsonc6
-rw-r--r--tests/specs/check/cjs_default_export/main.out7
-rw-r--r--tests/specs/check/cjs_default_export/main.ts4
3 files changed, 17 insertions, 0 deletions
diff --git a/tests/specs/check/cjs_default_export/__test__.jsonc b/tests/specs/check/cjs_default_export/__test__.jsonc
new file mode 100644
index 000000000..852942826
--- /dev/null
+++ b/tests/specs/check/cjs_default_export/__test__.jsonc
@@ -0,0 +1,6 @@
+{
+ "base": "npm",
+ "args": "check main.ts",
+ "output": "main.out",
+ "exitCode": 1
+}
diff --git a/tests/specs/check/cjs_default_export/main.out b/tests/specs/check/cjs_default_export/main.out
new file mode 100644
index 000000000..204488273
--- /dev/null
+++ b/tests/specs/check/cjs_default_export/main.out
@@ -0,0 +1,7 @@
+Download http://localhost:4545/npm/registry/@denotest/cjs-default-export
+Download http://localhost:4545/npm/registry/@denotest/cjs-default-export/1.0.0.tgz
+Check file:///[WILDCARD]/main.ts
+error: TS2322 [ERROR]: Type 'number' is not assignable to type 'string'.
+export const Test: string = cjsDefault.default();
+ ~~~~
+ at file:///[WILDCARD]/main.ts:4:14
diff --git a/tests/specs/check/cjs_default_export/main.ts b/tests/specs/check/cjs_default_export/main.ts
new file mode 100644
index 000000000..20a78f6d3
--- /dev/null
+++ b/tests/specs/check/cjs_default_export/main.ts
@@ -0,0 +1,4 @@
+import cjsDefault from "npm:@denotest/cjs-default-export";
+
+// should error since cjsDefault.default() is a number
+export const Test: string = cjsDefault.default();