Skip to content

Commit e23ddc6

Browse files
author
andy-ms
committed
Add test for import("./a")
1 parent e49f094 commit e23ddc6

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

tests/cases/fourslash/completionsImport_require.ts

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,16 @@
77

88
// @Filename: /b.js
99
////const a = require("./a");
10-
////fo/**/
10+
////fo/*b*/
1111

12-
goTo.marker("");
12+
// @Filename: /c.js
13+
////const a = import("./a");
14+
////fo/*c*/
15+
16+
goTo.marker("b");
1317
verify.completionListContains({ name: "foo", source: "/a" }, "const foo: 0", "", "const", /*spanIndex*/ undefined, /*hasAction*/ true);
1418

15-
verify.applyCodeActionFromCompletion("", {
19+
verify.applyCodeActionFromCompletion("b", {
1620
name: "foo",
1721
source: "/a",
1822
description: `Import 'foo' from "./a".`,
@@ -22,3 +26,17 @@ verify.applyCodeActionFromCompletion("", {
2226
const a = require("./a");
2327
fo`,
2428
});
29+
30+
goTo.marker("c");
31+
verify.completionListContains({ name: "foo", source: "/a" }, "const foo: 0", "", "const", /*spanIndex*/ undefined, /*hasAction*/ true);
32+
33+
verify.applyCodeActionFromCompletion("c", {
34+
name: "foo",
35+
source: "/a",
36+
description: `Import 'foo' from "./a".`,
37+
// TODO: GH#18445
38+
newFileContent: `import { foo } from "./a";\r
39+
\r
40+
const a = import("./a");
41+
fo`,
42+
});

0 commit comments

Comments
 (0)