TypeScript/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateOneExpr.ts

15 lines
429 B
TypeScript
Raw Normal View History

2018-12-06 10:54:23 +01:00
/// <reference path='fourslash.ts' />
//// const age = 42
//// const foo = "/*x*/f/*y*/oobar is " + age + " years old"
goTo.select("x", "y");
edit.applyRefactor({
refactorName: "Convert to template string",
actionName: "Convert to template string",
actionDescription: ts.Diagnostics.Convert_to_template_string.message,
2018-12-06 10:54:23 +01:00
newContent:
`const age = 42
const foo = \`foobar is \${age} years old\``,
});