Skip to content

Commit adf10d1

Browse files
committed
Test: add test case for issue 70 (closes #70)
1 parent 8b68a2a commit adf10d1

File tree

5 files changed

+78
-0
lines changed

5 files changed

+78
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<title>Animals</title>
6+
</head>
7+
8+
<body class="raccoons">
9+
<main class="unicorns">
10+
<section id="some-header">
11+
<h1>Hello this is dog</h1>
12+
<div class="container text-center d-flex flex-column justify-content-center align-items-center
13+
align-content-center ct-fluid">
14+
</div>
15+
</section>
16+
</main>
17+
</body>
18+
19+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.container {}
2+
.text-center {}
3+
.d-flex {}
4+
.flex-column {}
5+
.justify-content-center {}
6+
.align-items-center {}
7+
.align-content-center {}
8+
.ct-fluid {}
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<title>Animals</title>
6+
</head>
7+
8+
<body class="raccoons">
9+
<main class="unicorns">
10+
<section id="some-header">
11+
<h1>Hello this is dog</h1>
12+
<div class="a b c d e f
13+
g h">
14+
</div>
15+
</section>
16+
</main>
17+
</body>
18+
19+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.a {}
2+
.b {}
3+
.c {}
4+
.d {}
5+
.e {}
6+
.f {}
7+
.g {}
8+
.h {}

__tests__/integration.ts

+24
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,27 @@ test('issue #21 | with seperated process functions', async () => {
9494
expect(minify(newHtml, { collapseWhitespace: true }))
9595
.toBe(minify(expectedHtml, { collapseWhitespace: true }));
9696
});
97+
98+
test('issue #70 | line breaks', async () => {
99+
const issueFixture = path.join(testFiles, 'issue70/fixtures');
100+
const issueResults = path.join(testFiles, 'issue70/results');
101+
102+
await rcs.process.css('style.css', {
103+
newPath: testCwd.name,
104+
cwd: issueFixture,
105+
});
106+
107+
await rcs.process.html('index.html', {
108+
newPath: testCwd.name,
109+
cwd: issueFixture,
110+
});
111+
112+
const newCss = fs.readFileSync(path.join(testCwd.name, '/style.css'), 'utf8');
113+
const newHtml = fs.readFileSync(path.join(testCwd.name, '/index.html'), 'utf8');
114+
const expectedCss = fs.readFileSync(path.join(issueResults, '/style.css'), 'utf8');
115+
const expectedHtml = fs.readFileSync(path.join(issueResults, '/index.html'), 'utf8');
116+
117+
expect(newCss).toBe(expectedCss);
118+
expect(minify(newHtml, { collapseWhitespace: true }))
119+
.toBe(minify(expectedHtml, { collapseWhitespace: true }));
120+
});

0 commit comments

Comments
 (0)