Skip to content

Commit 1594507

Browse files
committed
Test cases for multiline string expressions
1 parent e0d1a16 commit 1594507

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test.js

+20
Original file line numberDiff line numberDiff line change
@@ -2622,6 +2622,26 @@ test('roundtrip', async function (t) {
26222622
equal(source, source)
26232623
}
26242624
)
2625+
2626+
await t.test(
2627+
'should roundtrip `JSX attributes containing new lines`',
2628+
async function () {
2629+
equal(
2630+
`<a\n text={\`\n0\n 1\n 2\n 3\n 4\n 5\`}\n/>\n`,
2631+
`<a\n text={\`\n0\n 1\n 2\n 3\n 4\n 5\`}\n/>\n`
2632+
)
2633+
}
2634+
)
2635+
2636+
await t.test(
2637+
'should roundtrip `JSX multiline string children`',
2638+
async function () {
2639+
equal(
2640+
`<a\n trigger={<b>{\`\n0\n 1\n 2\n 3\n 4\n 5\`}</b>}\n/>\n`,
2641+
`<a\n trigger={<b>{\`\n0\n 1\n 2\n 3\n 4\n 5\`}</b>}\n/>\n`
2642+
)
2643+
}
2644+
)
26252645
})
26262646

26272647
/**

0 commit comments

Comments
 (0)