add formatting tests for multi-line object destructuring
with insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces === false
This commit is contained in:
parent
0fd0903280
commit
40cd0b8dd3
2 changed files with 36 additions and 0 deletions
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};");
|
Loading…
Reference in a new issue