From 26f9a52e9252a6c4a1d65df4e2a5a0d187dbab24 Mon Sep 17 00:00:00 2001 From: Kanchalai Tanglertsampan Date: Mon, 13 Mar 2017 17:07:13 -0700 Subject: [PATCH] Add initial tests --- .../es2018/dynamicImport/importCallExpression1.ts | 11 +++++++++++ .../es2018/dynamicImport/importCallExpression2.ts | 10 ++++++++++ 2 files changed, 21 insertions(+) create mode 100644 tests/cases/conformance/es2018/dynamicImport/importCallExpression1.ts create mode 100644 tests/cases/conformance/es2018/dynamicImport/importCallExpression2.ts diff --git a/tests/cases/conformance/es2018/dynamicImport/importCallExpression1.ts b/tests/cases/conformance/es2018/dynamicImport/importCallExpression1.ts new file mode 100644 index 00000000000..f0fd00f9c79 --- /dev/null +++ b/tests/cases/conformance/es2018/dynamicImport/importCallExpression1.ts @@ -0,0 +1,11 @@ +// @module: es2018 +// @target: esnext +// @filename: 0.ts +export function foo() { return "foo"; } + +// @filename: 1.ts +import("./0"); +var p1 = import("./0"); +p1.then(zero => { + return zero.foo(); +}) \ No newline at end of file diff --git a/tests/cases/conformance/es2018/dynamicImport/importCallExpression2.ts b/tests/cases/conformance/es2018/dynamicImport/importCallExpression2.ts new file mode 100644 index 00000000000..57ea587ce73 --- /dev/null +++ b/tests/cases/conformance/es2018/dynamicImport/importCallExpression2.ts @@ -0,0 +1,10 @@ +// @module: es2018 +// @lib: es2015 +// @filename: 0.ts +export function foo(){} + +// @filename: 1.ts +import * as Zero from "./0" // Should preserve ES2015 module syntax +import("./0"); +var p1 = import("./0"); +export default p1;