TypeScript/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_templateLiteral.ts
Andrew Branch c1e0db7953
Escape apparent substitution in synthesized NoSubstitutionTemplateLiterals (#32580)
* Add failing test

* Escape apparent substitution in synthesized NoSubstitutionTemplateLiterals
2019-08-05 09:31:59 -07:00

17 lines
611 B
TypeScript

/// <reference path='fourslash.ts' />
////function /*a*/insert/*b*/(template: string, overwriteBefore = 0) {}
////insert(`this is \${not} a substitution`);
goTo.select("a", "b");
edit.applyRefactor({
refactorName: "Convert parameters to destructured object",
actionName: "Convert parameters to destructured object",
actionDescription: "Convert parameters to destructured object",
newContent: [
'function insert({ template, overwriteBefore = 0 }: { template: string; overwriteBefore?: number; }) {}',
'insert({ template: `this is \\${not} a substitution` });'
].join('\n')
});