mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-16 15:51:35 -05:00
add visibility tests
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
//// const age = 22
|
||||
//// const name = "Eddy"
|
||||
//// const /*z*/f/*y*/oo = /*x*/`/*w*/M/*v*/r/*u*/ /*t*/$/*s*/{ /*r*/n/*q*/ame } is $/*p*/{/*o*/ age } years old`
|
||||
|
||||
goTo.select("z", "y");
|
||||
verify.not.refactorAvailable("Convert string concatenation or template literal", "Convert to string concatenation")
|
||||
verify.not.refactorAvailable("Convert string concatenation or template literal", "Convert to template literal")
|
||||
|
||||
goTo.select("x", "w");
|
||||
verify.refactorAvailable("Convert string concatenation or template literal", "Convert to string concatenation")
|
||||
verify.not.refactorAvailable("Convert string concatenation or template literal", "Convert to template literal")
|
||||
|
||||
goTo.select("v", "u");
|
||||
verify.refactorAvailable("Convert string concatenation or template literal", "Convert to string concatenation")
|
||||
verify.not.refactorAvailable("Convert string concatenation or template literal", "Convert to template literal")
|
||||
|
||||
goTo.select("t", "s");
|
||||
verify.refactorAvailable("Convert string concatenation or template literal", "Convert to string concatenation")
|
||||
verify.not.refactorAvailable("Convert string concatenation or template literal", "Convert to template literal")
|
||||
|
||||
goTo.select("r", "q");
|
||||
verify.refactorAvailable("Convert string concatenation or template literal", "Convert to string concatenation")
|
||||
verify.not.refactorAvailable("Convert string concatenation or template literal", "Convert to template literal")
|
||||
|
||||
goTo.select("p", "o");
|
||||
verify.refactorAvailable("Convert string concatenation or template literal", "Convert to string concatenation")
|
||||
verify.not.refactorAvailable("Convert string concatenation or template literal", "Convert to template literal")
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
//// const age = 22
|
||||
//// const name = "Eddy"
|
||||
//// const foo = \`\${ /*x*/n/*y*/ame } is \${ age } years old\`
|
||||
//// const foo = `${ /*x*/n/*y*/ame } is ${ age } years old`
|
||||
|
||||
goTo.select("x", "y");
|
||||
edit.applyRefactor({
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
//// const age = 22
|
||||
//// const name = "Eddy"
|
||||
//// const /*z*/f/*y*/oo = /*x*/"/*w*/M/*v*/r/*u*/ " /*t*/+/*s*/ /*r*/n/*q*/ame + " is " + /*p*/a/*o*/ge + " years old"
|
||||
|
||||
goTo.select("z", "y");
|
||||
verify.not.refactorAvailable("Convert string concatenation or template literal", "Convert to string concatenation")
|
||||
verify.not.refactorAvailable("Convert string concatenation or template literal", "Convert to template literal")
|
||||
|
||||
goTo.select("x", "w");
|
||||
verify.not.refactorAvailable("Convert string concatenation or template literal", "Convert to string concatenation")
|
||||
verify.refactorAvailable("Convert string concatenation or template literal", "Convert to template literal")
|
||||
|
||||
goTo.select("v", "u");
|
||||
verify.not.refactorAvailable("Convert string concatenation or template literal", "Convert to string concatenation")
|
||||
verify.refactorAvailable("Convert string concatenation or template literal", "Convert to template literal")
|
||||
|
||||
goTo.select("t", "s");
|
||||
verify.not.refactorAvailable("Convert string concatenation or template literal", "Convert to string concatenation")
|
||||
verify.refactorAvailable("Convert string concatenation or template literal", "Convert to template literal")
|
||||
|
||||
goTo.select("r", "q");
|
||||
verify.not.refactorAvailable("Convert string concatenation or template literal", "Convert to string concatenation")
|
||||
verify.refactorAvailable("Convert string concatenation or template literal", "Convert to template literal")
|
||||
|
||||
goTo.select("p", "o");
|
||||
verify.not.refactorAvailable("Convert string concatenation or template literal", "Convert to string concatenation")
|
||||
verify.refactorAvailable("Convert string concatenation or template literal", "Convert to template literal")
|
||||
|
||||
Reference in New Issue
Block a user