Skip to content

Commit

Permalink
fix(minify) do not encode images to base64
Browse files Browse the repository at this point in the history
  • Loading branch information
coderaiser committed Oct 4, 2016
1 parent 2d5eaf2 commit 2e4dbb0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
Binary file added test/fixtures/ok.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions test/fixtures/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.header {
background-url: url('ok.png');
}
1 change: 1 addition & 0 deletions test/fixtures/style.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 16 additions & 1 deletion test/minify.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
'use strict';

const minify = require('..'),
const fs = require('fs');

const minify = require('..'),
test = require('tape'),
CleanCSS = require('clean-css'),
uglify = require('uglify-js'),
Expand Down Expand Up @@ -62,6 +64,19 @@ test('css', t => {
});
});

test.only('css: base64', (t) => {
const dir = `${__dirname}/fixtures`;
const name = `${dir}/style.css`;
const nameMin = `${dir}/style.min.css`;

const min = fs.readFileSync(nameMin, 'utf8');

minify(name, (error, data) => {
t.equal(min, data);
t.end();
});
});

test('arguments: no', t => {
t.throws(minify, /name could not be empty!/, 'throw when name empty');
t.end();
Expand Down

0 comments on commit 2e4dbb0

Please sign in to comment.