Skip to content

Commit 0b3fa73

Browse files
committed
Fix failing tests for extract-css package.
1 parent b4dba50 commit 0b3fa73

File tree

6 files changed

+13
-11
lines changed

6 files changed

+13
-11
lines changed

packages/extract-css/test/expected/codeblocks.html

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<html>
2+
<head>
3+
</head>
24
<body>
35
{{#if `age <= 40`}}<p>Young</p>{{/if}}
46
</body>
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
<html><body style="padding-top: 20px;"></body></html>
1+
<html><head></head><body style="padding-top: 20px;">
2+
</body></html>

packages/extract-css/test/expected/out.html

+5-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77
<body>
88
<h1>Hi</h1>
99
<table>
10-
<tr>
11-
<td class="headline">Some Headline</td>
12-
</tr>
10+
<tbody>
11+
<tr>
12+
<td class="headline">Some Headline</td>
13+
</tr>
14+
</tbody>
1315
</table>
1416
</body>
1517
</html>
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
<html><link rel="stylesheet" href="codeblocks.css" />
22
<body>
3-
{{#if `age <= 40`}}<p>Young</p>{{/if}}
4-
</body>
5-
</html>
3+
{{#if `age <= 40`}}<p>Young</p>{{/if}}</body></html>
64

packages/extract-css/test/fixtures/in.html

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,4 @@ <h1>Hi</h1>
1414
<tr>
1515
<td class="headline">Some Headline</td>
1616
</tr>
17-
</table>
18-
</body>
19-
</html>
17+
</table></body></html>

packages/extract-css/test/main.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const should = require('should');
44
const fs = require('fs');
55
const path = require('path');
66
const Vinyl = require('vinyl');
7+
const beautify = require('js-beautify').html;
78
const extractCss = require('../index');
89

910
function getFile(filePath) {
@@ -21,7 +22,7 @@ function compare(fixturePath, expectedHTML, expectedCSS, options, done) {
2122
options.url = `file://${file.path}`;
2223

2324
extractCss(file.contents.toString('utf8'), options, (err, html, css) => {
24-
html.should.be.equal(String(fs.readFileSync(expectedHTML)));
25+
beautify(html).should.be.equal(beautify(String(fs.readFileSync(expectedHTML))));
2526
css.should.be.equal(String(fs.readFileSync(expectedCSS)));
2627

2728
done();

0 commit comments

Comments
 (0)