mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
fix(40609): add tests to cover TemplateLiteralType extraction (#40834)
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
////const key = "key";
|
||||
////type Foo = /*a*/`${typeof key}Foo`/*b*/;
|
||||
|
||||
goTo.select("a", "b");
|
||||
edit.applyRefactor({
|
||||
refactorName: "Extract type",
|
||||
actionName: "Extract to type alias",
|
||||
actionDescription: "Extract to type alias",
|
||||
newContent: [
|
||||
"const key = \"key\";",
|
||||
"type /*RENAME*/NewType = `${typeof key}Foo`;",
|
||||
"",
|
||||
"type Foo = NewType;"
|
||||
].join("\n"),
|
||||
});
|
||||
Reference in New Issue
Block a user