~~ lineWidth: 40 ~~ == should format == log(`testing`); [expect] log(`testing`); == should format multiple lines without indentation == function test() { log(` const t = 5; `); } [expect] function test() { log(` const t = 5; `); } == should do string iterpolation == log(`testing ${ 3 } this ${ 6 } out`); [expect] log(`testing ${3} this ${6} out`); == should not indent within the expression when it goes over the line width and the expression has no possible newlines == `testing this out a little bit ${4} testing`; [expect] `testing this out a little bit ${4} testing`; == should indent within the expression when it goes over the line width and the expression has possible newlines == `testing this out a little bit ${[4]} testing`; [expect] `testing this out a little bit ${[ 4, ]} testing`; == should move conditional expressions to the next line when they exceed the line width == function test() { `const t = 5; ${test ? test : testing}`; } [expect] function test() { `const t = 5; ${ test ? test : testing }`; } == should handle conditional expressions that exceed the line width twice == `const t = 5; ${test ? test : testingttttttttttttttttttttttt}`; [expect] `const t = 5; ${ test ? test : testingttttttttttttttttttttttt }`; == should handle conditional expr in this scenario == const errMsg = `${name} test ${required === 1 ? "" : "s"}, but only ${length} present`; [expect] const errMsg = `${name} test ${ required === 1 ? "" : "s" }, but only ${length} present`; == should handle conditional expr when the conditional expr cons is on the line width and not make the cond expr multi-line == const errMsg = `${testttttttt === 1 ? "" : "s"}, but only ${length} present`; [expect] const errMsg = `${ testttttttt === 1 ? "" : "s" }, but only ${length} present`; == should do a tagged template literal == log(myTag `some text`); [expect] log(myTag`some text`); == should not do a tagged template literal that goes over line width == myCustomTag `testing this out with an str`; [expect] myCustomTag`testing this out with an str`; == should not do newlines for a member expression == `tttttttttttttest ${testing.this.out.testing}`; [expect] `tttttttttttttest ${testing.this.out.testing}`; == should not do newlines for a member expression with a this, super prop expr, or import meta expr == `tttttttttttttest ${this.this.out.testing} or ${super.test} or ${import.meta}`; [expect] `tttttttttttttest ${this.this.out.testing} or ${super.test} or ${import.meta}`; == should not do newlines for a member expression with a string literal == `tttttttttttttest ${"testing this out".test}`; [expect] `tttttttttttttest ${"testing this out".test}`; == should not do newlines for a private property name == `tttttttttttttest ${ttttttttttttttt.#test}`; [expect] `tttttttttttttest ${ttttttttttttttt.#test}`; == should do newlines for a member expression with a computed property == `${days[date.getUTCDay()]}, ${d} ${months[date.getUTCMonth()]} ${y} ${h}:${testtt}:${s} GMT`; [expect] `${days[date.getUTCDay()]}, ${d} ${ months[date.getUTCMonth()] } ${y} ${h}:${testtt}:${s} GMT`; == should not break up call expressions with no argument == `${date.getUTCDay()}, ${d} ${date.getUTCMonth()} ${y} ${h}:${testtt}:${s} GMT`; [expect] `${date.getUTCDay()}, ${d} ${date.getUTCMonth()} ${y} ${h}:${testtt}:${s} GMT`; == should break up call expressions with an argument == `${date.getUTCDay()}, ${d} ${date.getUTCMonth(test)} ${y} ${h}:${testtt}:${s} GMT`; [expect] `${date.getUTCDay()}, ${d} ${ date.getUTCMonth(test) } ${y} ${h}:${testtt}:${s} GMT`; == should place opening backtick in same line if it starts with newline == const b = () => ` test `; [expect] const b = () => ` test `; == should place opening backtick in different line if it starts with a non-newline character == const test = () => `testing this out testing testing testing testin gtesting testing` [expect] const test = () => `testing this out testing testing testing testin gtesting testing`; == should move a binary expression to its own line == const test = `test test test test ${props.class ?? ""}`; const test = `test test test test ${1 + 25 + 2}`; [expect] const test = `test test test test ${ props.class ?? "" }`; const test = `test test test test ${ 1 + 25 + 2 }`; == should print comments in template literals substitutions == `a${/* 1 */""/* 2 */}b`; `a${/* testing this out */"testing test testing"/* testing this out */}b`; `a${ /* 3 */ "" /* 4 */ }b`; `a${ // 5 "" // 6 }b` [expect] `a${/* 1 */ "" /* 2 */}b`; `a${/* testing this out */ "testing test testing" /* testing this out */}b`; `a${ /* 3 */ "" /* 4 */ }b`; `a${ // 5 "" // 6 }b`;