Skip to content

Commit

Permalink
Fix failing tests for extract-css package.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonkemp committed Jul 7, 2022
1 parent b4dba50 commit 0b3fa73
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
2 changes: 2 additions & 0 deletions packages/extract-css/test/expected/codeblocks.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<html>
<head>
</head>
<body>
{{#if `age <= 40`}}<p>Young</p>{{/if}}
</body>
Expand Down
3 changes: 2 additions & 1 deletion packages/extract-css/test/expected/malformed.html
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
<html><body style="padding-top: 20px;"></body></html>
<html><head></head><body style="padding-top: 20px;">
</body></html>
8 changes: 5 additions & 3 deletions packages/extract-css/test/expected/out.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
<body>
<h1>Hi</h1>
<table>
<tr>
<td class="headline">Some Headline</td>
</tr>
<tbody>
<tr>
<td class="headline">Some Headline</td>
</tr>
</tbody>
</table>
</body>
</html>
4 changes: 1 addition & 3 deletions packages/extract-css/test/fixtures/codeblocks.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<html><link rel="stylesheet" href="codeblocks.css" />
<body>
{{#if `age <= 40`}}<p>Young</p>{{/if}}
</body>
</html>
{{#if `age <= 40`}}<p>Young</p>{{/if}}</body></html>

4 changes: 1 addition & 3 deletions packages/extract-css/test/fixtures/in.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,4 @@ <h1>Hi</h1>
<tr>
<td class="headline">Some Headline</td>
</tr>
</table>
</body>
</html>
</table></body></html>
3 changes: 2 additions & 1 deletion packages/extract-css/test/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const should = require('should');
const fs = require('fs');
const path = require('path');
const Vinyl = require('vinyl');
const beautify = require('js-beautify').html;
const extractCss = require('../index');

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

extractCss(file.contents.toString('utf8'), options, (err, html, css) => {
html.should.be.equal(String(fs.readFileSync(expectedHTML)));
beautify(html).should.be.equal(beautify(String(fs.readFileSync(expectedHTML))));
css.should.be.equal(String(fs.readFileSync(expectedCSS)));

done();
Expand Down

0 comments on commit 0b3fa73

Please sign in to comment.