Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #7 from asset-pipe/develop
Browse files Browse the repository at this point in the history
fix: Ensure newline between concatenated CSS chunks
  • Loading branch information
digitalsadhu authored Nov 1, 2017
2 parents 7a70836 + b2cd534 commit d6a07f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ module.exports = class Reader extends Readable {
this.data.pause();

this.data.on('data', chunk => {
this.push(chunk.content);
this.push(`${chunk.content.trim()}\n\n`);
});

this.data.on('end', () => {
Expand Down
12 changes: 6 additions & 6 deletions test/reader.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,9 @@ test('new Reader([s1,s2,s3,s4]) ensure dedupe and correct css concat order', don
reader.on('data', data => bundle.push(data.toString()));
reader.on('end', () => {
expect(bundle).toEqual([
'/* my-module-3/main.css */\n\n/* my-module-3/dep.css */\n\n/* dep/main.css */\n',
'/* my-module-2/main.css */\n',
'/* my-module-1/main.css */\n',
'/* my-module-3/main.css */\n\n/* my-module-3/dep.css */\n\n/* dep/main.css */\n\n',
'/* my-module-2/main.css */\n\n',
'/* my-module-1/main.css */\n\n',
]);
done();
});
Expand Down Expand Up @@ -275,9 +275,9 @@ test('new Reader([s1,s2,s3,s4]) operates correctly under slow speed conditions',
reader.on('data', data => bundle.push(data.toString()));
reader.on('end', () => {
expect(bundle).toEqual([
'/* my-module-3/main.css */\n\n/* my-module-3/dep.css */\n\n/* dep/main.css */\n',
'/* my-module-2/main.css */\n',
'/* my-module-1/main.css */\n',
'/* my-module-3/main.css */\n\n/* my-module-3/dep.css */\n\n/* dep/main.css */\n\n',
'/* my-module-2/main.css */\n\n',
'/* my-module-1/main.css */\n\n',
]);
done();
});
Expand Down

0 comments on commit d6a07f0

Please sign in to comment.