add formatting tests for multi-line object destructuring

with insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces === false
This commit is contained in:
Hendrik Liebau 2017-03-28 17:42:46 +02:00
parent 0fd0903280
commit 40cd0b8dd3
2 changed files with 36 additions and 0 deletions

View 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 };");

View 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};");