TypeScript/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_escapedBackslashes.ts
Andrew Branch 57f9076612
Remove extraneous string escape from convert to template string refactor (#37743)
* Add failing test

* Remove extraneous string escape

* Revert unnecessary change
2020-04-09 09:40:28 -07:00

16 lines
594 B
TypeScript

/// <reference path='fourslash.ts' />
//// console.log(/*0*/"\\[[" + text + "](" + link + ")\\]"/*1*/)
goTo.select("0", "1");
edit.applyRefactor({
refactorName: "Convert to template string",
actionName: "Convert to template string",
actionDescription: ts.Diagnostics.Convert_to_template_string.message,
// Four backslashes here
// = two backslashes in the expected file content
// = one backslash in the string data sent to console.log
// (which is the same as what the user started with)
newContent: 'console.log(`\\\\[[${text}](${link})\\\\]`)',
});