diff --git a/lib/tools/weightChecker/gzipCompressor.js b/lib/tools/weightChecker/gzipCompressor.js index b3f8e33..15e0e4d 100644 --- a/lib/tools/weightChecker/gzipCompressor.js +++ b/lib/tools/weightChecker/gzipCompressor.js @@ -66,7 +66,7 @@ var GzipCompressor = function() { var compressedSize = buffer.length; if (gainIsEnough(uncompressedSize, compressedSize)) { - debug('Minified file correctly gziped, was %d and is now %d bytes', uncompressedSize, compressedSize); + debug('Correctly gziped the minified file, was %d and is now %d bytes', uncompressedSize, compressedSize); entry.weightCheck.afterOptimizationAndCompression = compressedSize; } else { diff --git a/lib/tools/weightChecker/imageOptimizer.js b/lib/tools/weightChecker/imageOptimizer.js index 06fc9fa..a0b90d5 100644 --- a/lib/tools/weightChecker/imageOptimizer.js +++ b/lib/tools/weightChecker/imageOptimizer.js @@ -129,7 +129,7 @@ var ImageOptimizer = function() { debug('SVG lossless compression complete for %s', entry.url); if (gainIsEnough(fileSize, newFileSize)) { - entry.weightCheck.bodyAfterOptimization = newFile; + entry.weightCheck.bodyAfterOptimization = newFile.contents.toString(); entry.weightCheck.lossless = entry.weightCheck.optimized = newFileSize; entry.weightCheck.isOptimized = false; debug('Filesize is %d bytes smaller (-%d%)', fileSize - newFileSize, Math.round((fileSize - newFileSize) * 100 / fileSize)); diff --git a/test/core/fileMinifierTest.js b/test/core/fileMinifierTest.js index b06d012..33e3db3 100644 --- a/test/core/fileMinifierTest.js +++ b/test/core/fileMinifierTest.js @@ -51,7 +51,7 @@ describe('fileMinifier', function() { .then(function(newEntry) { newEntry.weightCheck.should.have.a.property('isOptimized').that.equals(false); newEntry.weightCheck.should.have.a.property('optimized').that.is.below(fileSize); - newEntry.weightCheck.should.have.a.property('bodyAfterOptimization'); + newEntry.weightCheck.should.have.a.property('bodyAfterOptimization').that.is.a('string'); done(); }) @@ -193,7 +193,7 @@ describe('fileMinifier', function() { .then(function(newEntry) { newEntry.weightCheck.should.have.a.property('isOptimized').that.equals(false); newEntry.weightCheck.should.have.a.property('optimized').that.is.below(fileSize); - newEntry.weightCheck.should.have.a.property('bodyAfterOptimization'); + newEntry.weightCheck.should.have.a.property('bodyAfterOptimization').that.is.a('string'); done(); }) diff --git a/test/core/imageOptimizerTest.js b/test/core/imageOptimizerTest.js index 3f5f923..ba273db 100644 --- a/test/core/imageOptimizerTest.js +++ b/test/core/imageOptimizerTest.js @@ -208,7 +208,7 @@ describe('imageOptimizer', function() { newEntry.weightCheck.should.have.a.property('isOptimized').that.equals(false); newEntry.weightCheck.should.have.a.property('lossless').that.is.below(fileSize); newEntry.weightCheck.should.have.a.property('optimized').that.equals(newEntry.weightCheck.lossless); - newEntry.weightCheck.should.have.a.property('bodyAfterOptimization'); + newEntry.weightCheck.should.have.a.property('bodyAfterOptimization').that.is.a('string'); done(); })