Skip to content

Commit 9fa112e

Browse files
committed
test also the output from visibility tests
1 parent 834c5df commit 9fa112e

4 files changed

+34
-0
lines changed

tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToStringAvailability.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,12 @@ goTo.select("p", "o");
2828
verify.refactorAvailable("Convert string concatenation or template literal", "Convert to string concatenation");
2929
verify.not.refactorAvailable("Convert string concatenation or template literal", "Convert to template literal");
3030

31+
edit.applyRefactor({
32+
refactorName: "Convert string concatenation or template literal",
33+
actionName: "Convert to string concatenation",
34+
actionDescription: "Convert to string concatenation",
35+
newContent:
36+
`const age = 22
37+
const name = "Eddy"
38+
const foo = "Mr " + name + " is " + (age + 34) + " years old"`,
39+
});

tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateAvailability.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,12 @@ goTo.select("p", "o");
2828
verify.not.refactorAvailable("Convert string concatenation or template literal", "Convert to string concatenation");
2929
verify.refactorAvailable("Convert string concatenation or template literal", "Convert to template literal");
3030

31+
edit.applyRefactor({
32+
refactorName: "Convert string concatenation or template literal",
33+
actionName: "Convert to template literal",
34+
actionDescription: "Convert to template literal",
35+
newContent:
36+
`const age = 22
37+
const name = "Eddy"
38+
const foo = \`Mr \${name} is \${age * 4 / 2} years old\``,
39+
});

tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateAvailabilityPrecedingMinus.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,11 @@ goTo.select("r", "q");
2323
verify.not.refactorAvailable("Convert string concatenation or template literal", "Convert to string concatenation");
2424
verify.refactorAvailable("Convert string concatenation or template literal", "Convert to template literal");
2525

26+
edit.applyRefactor({
27+
refactorName: "Convert string concatenation or template literal",
28+
actionName: "Convert to template literal",
29+
actionDescription: "Convert to template literal",
30+
newContent:
31+
`const age = 22
32+
const foo = \`\${age * 4 - 2 / 4} years old\``,
33+
});

tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateAvailabilityReassignment.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,11 @@ goTo.select("v", "u");
1515
verify.not.refactorAvailable("Convert string concatenation or template literal", "Convert to string concatenation");
1616
verify.refactorAvailable("Convert string concatenation or template literal", "Convert to template literal");
1717

18+
edit.applyRefactor({
19+
refactorName: "Convert string concatenation or template literal",
20+
actionName: "Convert to template literal",
21+
actionDescription: "Convert to template literal",
22+
newContent:
23+
`let foo = ""
24+
foo = \`Mr Bar is\${42} years old\``,
25+
});

0 commit comments

Comments
 (0)