diff --git a/tests/cases/fourslash/formattingOptionsChangeJsx.ts b/tests/cases/fourslash/formattingOptionsChangeJsx.ts index 067f0b882f2..363b53fe81c 100644 --- a/tests/cases/fourslash/formattingOptionsChangeJsx.ts +++ b/tests/cases/fourslash/formattingOptionsChangeJsx.ts @@ -1,37 +1,39 @@ /// //@Filename: file.tsx -/////*InsertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces1*/; +/////*1*/; //// //// -runTest("InsertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces1", ";", ";"); -runTest("InsertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces2", " { ...this._getButtonProps() }", " {...this._getButtonProps()}"); +runTest("1", ";", ";"); +runTest("2", " { ...this._getButtonProps() }", " {...this._getButtonProps()}"); -function runTest(propertyName: string, expectedStringWhenTrue: string, expectedStringWhenFalse: string) { +function runTest(markerName: string, expectedStringWhenTrue: string, expectedStringWhenFalse: string) { + const propertyName = "InsertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"; + // Go to the correct file - goTo.marker(propertyName); + goTo.marker(markerName); // Set the option to false first - format.setOption(propertyName.slice(0, -1), false); + format.setOption(propertyName, false); // Format format.document(); // Verify - goTo.marker(propertyName); + goTo.marker(markerName); verify.currentLineContentIs(expectedStringWhenFalse); // Set the option to true - format.setOption(propertyName.slice(0, -1), true); + format.setOption(propertyName, true); // Format format.document(); // Verify - goTo.marker(propertyName); + goTo.marker(markerName); verify.currentLineContentIs(expectedStringWhenTrue); } \ No newline at end of file