Skip to content

Commit

Permalink
add test to server-side-rendering/samples
Browse files Browse the repository at this point in the history
  • Loading branch information
confraria committed Apr 29, 2020
1 parent 06a8668 commit d78b936
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/server-side-rendering/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ describe("ssr", () => {
if (css.code) fs.writeFileSync(`${dir}/_actual.css`, css.code);

try {
assert.htmlEqual(html, expectedHtml);
if (compileOptions.preserveComments) {
assert.equal(html.trim(), expectedHtml.trim());
} else {
assert.htmlEqual(html, expectedHtml);
}
} catch (error) {
if (shouldUpdateExpected()) {
fs.writeFileSync(`${dir}/_expected.html`, html);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default {
compileOptions: {
preserveComments: true
}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<p>before</p>
<!-- a comment -->
<p>after</p>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<p>before</p>
<!-- a comment -->
<p>after</p>

0 comments on commit d78b936

Please sign in to comment.