add test cases

This commit is contained in:
BigAru
2018-12-05 06:00:28 +01:00
parent 2db0745b64
commit 7620615212
4 changed files with 54 additions and 0 deletions
@@ -0,0 +1,12 @@
/// <reference path='fourslash.ts' />
//// const foo = "/*x*/f/*y*/oobar is " + (42 + 6) + " years old"
goTo.select("x", "y");
edit.applyRefactor({
refactorName: "Convert string concatenation or template literal",
actionName: "Convert to template literal",
actionDescription: "Convert to template literal",
newContent:
`const foo = \`foobar is \${ 42 + 6 } years old\``,
});
@@ -0,0 +1,16 @@
/// <reference path='fourslash.ts' />
//// const age = 22
//// const name = "Eddy"
//// const foo = /*x*/n/*y*/ame + " is " + age + " years old"
goTo.select("x", "y");
edit.applyRefactor({
refactorName: "Convert string concatenation or template literal",
actionName: "Convert to template literal",
actionDescription: "Convert to template literal",
newContent:
`const age = 22
const name = "Eddy"
const foo = \`\${ name } is \${ age } years old\``,
});
@@ -0,0 +1,14 @@
/// <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 string concatenation or template literal",
actionName: "Convert to template literal",
actionDescription: "Convert to template literal",
newContent:
`const age = 42
const foo = \`foobar is \${ age } years old\``,
});
@@ -0,0 +1,12 @@
/// <reference path='fourslash.ts' />
//// const foo = "/*x*/f/*y*/oobar rocks"
goTo.select("x", "y");
edit.applyRefactor({
refactorName: "Convert string concatenation or template literal",
actionName: "Convert to template literal",
actionDescription: "Convert to template literal",
newContent:
`const foo = \`foobar rocks\``,
});