Skip to content

Commit

Permalink
Test cases for multiline string expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
bradleyayers committed Oct 26, 2024
1 parent e0d1a16 commit 1594507
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2622,6 +2622,26 @@ test('roundtrip', async function (t) {
equal(source, source)
}
)

await t.test(
'should roundtrip `JSX attributes containing new lines`',
async function () {
equal(
`<a\n text={\`\n0\n 1\n 2\n 3\n 4\n 5\`}\n/>\n`,
`<a\n text={\`\n0\n 1\n 2\n 3\n 4\n 5\`}\n/>\n`
)
}
)

await t.test(
'should roundtrip `JSX multiline string children`',
async function () {
equal(
`<a\n trigger={<b>{\`\n0\n 1\n 2\n 3\n 4\n 5\`}</b>}\n/>\n`,
`<a\n trigger={<b>{\`\n0\n 1\n 2\n 3\n 4\n 5\`}</b>}\n/>\n`
)
}
)
})

/**
Expand Down

0 comments on commit 1594507

Please sign in to comment.