From 56dd518dd58980119f9515f1319656440cf06a9b Mon Sep 17 00:00:00 2001 From: Alexander T Date: Tue, 29 Sep 2020 21:10:28 +0300 Subject: [PATCH] fix(40609): add tests to cover TemplateLiteralType extraction --- tests/cases/fourslash/refactorExtractType71.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/cases/fourslash/refactorExtractType71.ts diff --git a/tests/cases/fourslash/refactorExtractType71.ts b/tests/cases/fourslash/refactorExtractType71.ts new file mode 100644 index 0000000000000..5f86c4a67ae43 --- /dev/null +++ b/tests/cases/fourslash/refactorExtractType71.ts @@ -0,0 +1,17 @@ +/// + +////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"), +});