From a4d4acd1aff3f6213d43d921624d69195c379744 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Thu, 27 Oct 2022 17:54:46 -0400 Subject: chore(npm): add explicit tests for `module.exports` assignment with type checking (#16435) --- .../testdata/npm/cjs_module_export_assignment_number/main.out | 3 +++ cli/tests/testdata/npm/cjs_module_export_assignment_number/main.ts | 7 +++++++ 2 files changed, 10 insertions(+) create mode 100644 cli/tests/testdata/npm/cjs_module_export_assignment_number/main.out create mode 100644 cli/tests/testdata/npm/cjs_module_export_assignment_number/main.ts (limited to 'cli/tests/testdata/npm/cjs_module_export_assignment_number') diff --git a/cli/tests/testdata/npm/cjs_module_export_assignment_number/main.out b/cli/tests/testdata/npm/cjs_module_export_assignment_number/main.out new file mode 100644 index 000000000..c808f4143 --- /dev/null +++ b/cli/tests/testdata/npm/cjs_module_export_assignment_number/main.out @@ -0,0 +1,3 @@ +5 +5 +Module { default: 5 } diff --git a/cli/tests/testdata/npm/cjs_module_export_assignment_number/main.ts b/cli/tests/testdata/npm/cjs_module_export_assignment_number/main.ts new file mode 100644 index 000000000..aee24bf19 --- /dev/null +++ b/cli/tests/testdata/npm/cjs_module_export_assignment_number/main.ts @@ -0,0 +1,7 @@ +import defaultImport, * as namespaceImport from "npm:@denotest/cjs-module-export-assignment-number"; + +const testDefault: 5 = defaultImport; +console.log(testDefault); +const testNamespace: 5 = namespaceImport.default; +console.log(testNamespace); +console.log(namespaceImport); -- cgit v1.2.3