Skip to content

Commit 249f446

Browse files
author
Kanchalai Tanglertsampan
committed
Update tests
1 parent 32e5cf7 commit 249f446

6 files changed

Lines changed: 32 additions & 2 deletions

tests/cases/conformance/es2018/dynamicImport/importCallExpression2ES2018.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ export class B {
66
}
77

88
// @filename: 2.ts
9-
// We use Promise<any> for now as there is no way to specify shape of module object
109
function foo(x: Promise<any>) {
1110
x.then(value => {
1211
let b = new value.B();
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// @module: commonjs
2+
// @target: es6
3+
// @noImplicitAny: true
4+
5+
// @filename: anotherModule.ts
6+
export class D{}
7+
8+
// @filename: defaultPath.ts
9+
export class C {}
10+
11+
// @filename: 1.ts
12+
import * as defaultModule from "./defaultPath";
13+
import * as anotherModule from "./anotherModule";
14+
15+
let p1: Promise<typeof anotherModule> = import("./defaultPath");
16+
let p2 = import("./defaultPath") as Promise<typeof anotherModule>;
17+
let p3: Promise<any> = import("./defaultPath");

tests/cases/conformance/es2018/dynamicImport/importCallExpressionDeclarationEmit2.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@
66
export function foo() { return "foo"; }
77

88
// @filename: 1.ts
9-
import("./0");
109
var p1 = import("./0");
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// @module: es2018
2+
// @target: esnext
3+
// @declaration: true
4+
5+
// @filename: 0.ts
6+
export function foo() { return "foo"; }
7+
8+
// @filename: 1.ts
9+
declare function getPath(): string;
10+
import * as Zero from "./0";
11+
import("./0");
12+
13+
export var p0: Promise<typeof Zero> = import(getPath());
14+
export var p1: Promise<typeof Zero> = import("./0");
15+
export var p2: Promise<any> = import("./0");

tests/cases/conformance/es2018/dynamicImport/importCallExpressionAllowInScriptContext1.ts renamed to tests/cases/conformance/es2018/dynamicImport/importCallExpressionInScriptContext1.ts

File renamed without changes.

tests/cases/conformance/es2018/dynamicImport/importCallExpressionAllowInScriptContext2.ts renamed to tests/cases/conformance/es2018/dynamicImport/importCallExpressionInScriptContext2.ts

File renamed without changes.

0 commit comments

Comments
 (0)