mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-09 07:55:10 -05:00
add formatting tests for multi-line object destructuring
with insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces === false
This commit is contained in:
17
tests/cases/fourslash/formattingInDestructuring3.ts
Normal file
17
tests/cases/fourslash/formattingInDestructuring3.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
/////*1*/const {
|
||||
/////*2*/ a,
|
||||
/////*3*/ b,
|
||||
/////*4*/} = { a: 1, b: 2 };
|
||||
|
||||
format.document();
|
||||
|
||||
goTo.marker("1");
|
||||
verify.currentLineContentIs("const {");
|
||||
goTo.marker("2");
|
||||
verify.currentLineContentIs(" a,");
|
||||
goTo.marker("3");
|
||||
verify.currentLineContentIs(" b,");
|
||||
goTo.marker("4");
|
||||
verify.currentLineContentIs("} = { a: 1, b: 2 };");
|
||||
19
tests/cases/fourslash/formattingInDestructuring4.ts
Normal file
19
tests/cases/fourslash/formattingInDestructuring4.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
/////*1*/const {
|
||||
/////*2*/ a,
|
||||
/////*3*/ b,
|
||||
/////*4*/} = { a: 1, b: 2 };
|
||||
|
||||
format.setOption('InsertSpaceAfterOpeningAndBeforeClosingNonemptyBraces', false);
|
||||
|
||||
format.document();
|
||||
|
||||
goTo.marker("1");
|
||||
verify.currentLineContentIs("const {");
|
||||
goTo.marker("2");
|
||||
verify.currentLineContentIs(" a,");
|
||||
goTo.marker("3");
|
||||
verify.currentLineContentIs(" b,");
|
||||
goTo.marker("4");
|
||||
verify.currentLineContentIs("} = {a: 1, b: 2};");
|
||||
Reference in New Issue
Block a user