62 lines
1.1 KiB
Go
62 lines
1.1 KiB
Go
// Code generated by convertFourslash; DO NOT EDIT.
|
|
// To modify this test, run "npm run makemanual formattingObjectLiteralOpenCurlyNewlineAssignment"
|
|
|
|
package fourslash_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/microsoft/typescript-go/internal/core"
|
|
"github.com/microsoft/typescript-go/internal/fourslash"
|
|
"github.com/microsoft/typescript-go/internal/testutil"
|
|
)
|
|
|
|
func TestFormattingObjectLiteralOpenCurlyNewlineAssignment(t *testing.T) {
|
|
fourslash.SkipIfFailing(t)
|
|
t.Parallel()
|
|
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
|
|
const content = `
|
|
var obj = {};
|
|
obj =
|
|
{
|
|
prop: 3
|
|
};
|
|
|
|
var obj2 = obj ||
|
|
{
|
|
prop: 0
|
|
}
|
|
`
|
|
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
|
|
defer done()
|
|
f.FormatDocument(t, "")
|
|
f.VerifyCurrentFileContent(t, `
|
|
var obj = {};
|
|
obj =
|
|
{
|
|
prop: 3
|
|
};
|
|
|
|
var obj2 = obj ||
|
|
{
|
|
prop: 0
|
|
}
|
|
`)
|
|
opts400 := f.GetOptions()
|
|
opts400.FormatCodeSettings.IndentMultiLineObjectLiteralBeginningOnBlankLine = core.TSTrue
|
|
f.Configure(t, opts400)
|
|
f.FormatDocument(t, "")
|
|
f.VerifyCurrentFileContent(t, `
|
|
var obj = {};
|
|
obj =
|
|
{
|
|
prop: 3
|
|
};
|
|
|
|
var obj2 = obj ||
|
|
{
|
|
prop: 0
|
|
}
|
|
`)
|
|
}
|