fix(40609): add tests to cover TemplateLiteralType extraction (#40834)

This commit is contained in:
Alex T
2020-09-29 11:29:51 -07:00
committed by GitHub
parent 7c0f0d2c69
commit 1e9f42fb16
@@ -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"),
});