Skip to content

Commit 1e9f42f

Browse files
authored
fix(40609): add tests to cover TemplateLiteralType extraction (#40834)
1 parent 7c0f0d2 commit 1e9f42f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/// <reference path='fourslash.ts' />
2+
3+
////const key = "key";
4+
////type Foo = /*a*/`${typeof key}Foo`/*b*/;
5+
6+
goTo.select("a", "b");
7+
edit.applyRefactor({
8+
refactorName: "Extract type",
9+
actionName: "Extract to type alias",
10+
actionDescription: "Extract to type alias",
11+
newContent: [
12+
"const key = \"key\";",
13+
"type /*RENAME*/NewType = `${typeof key}Foo`;",
14+
"",
15+
"type Foo = NewType;"
16+
].join("\n"),
17+
});

0 commit comments

Comments
 (0)