Permalink
Browse files

fix tests

  • Loading branch information...
pierreinglebert committed Jul 25, 2013
1 parent 3cc3970 commit 94a2db2a90a4cfa236b37a82fbb3f63371cbab17
Showing with 12 additions and 29 deletions.
  1. +12 −29 test/compress_test.js
View
@@ -1,38 +1,18 @@
-'use strict';
-
var grunt = require('grunt');
var path = require('path');
var zlib = require('zlib');
var fs = require('fs');
-var unzip = require('unzip');
var tar = require('tar');
-var compress = require('../tasks/lib/compress')(grunt);
+var zopfli = require('../tasks/lib/zopfli')(grunt);
exports.compress = {
- zip: function(test) {
- test.expect(1);
- var expected = [
- 'folder_one/one.css', 'folder_one/one.js',
- 'folder_two/two.css', 'folder_two/two.js',
- 'test.css', 'test.js',
- ];
- var actual = [];
- var parse = unzip.Parse();
- fs.createReadStream(path.join('tmp', 'compress_test_files.zip')).pipe(parse);
- parse.on('entry', function(entry) {
- actual.push(entry.path);
- });
- parse.on('close', function() {
- test.deepEqual(actual, expected, 'zip file should unzip and contain all of the expected files');
- test.done();
- });
- },
+ /*
tar: function(test) {
test.expect(1);
var expected = [
'folder_one/one.css', 'folder_one/one.js',
'folder_two/two.css', 'folder_two/two.js',
- 'test.css', 'test.js',
+ 'test.css', 'test.js'
];
var actual = [];
var parse = tar.Parse();
@@ -50,7 +30,7 @@ exports.compress = {
var expected = [
'folder_one/one.css', 'folder_one/one.js',
'folder_two/two.css', 'folder_two/two.js',
- 'test.css', 'test.js',
+ 'test.css', 'test.js'
];
var actual = [];
var parse = tar.Parse();
@@ -65,12 +45,13 @@ exports.compress = {
test.done();
});
},
+ */
gzip: function(test) {
test.expect(3);
grunt.util.async.forEachSeries([
'test.js',
path.join('folder_one', 'one.css'),
- path.join('folder_two', 'two.js'),
+ path.join('folder_two', 'two.js')
], function(file, next) {
var expected = grunt.file.read(path.join('test', 'fixtures', file));
var actual = '';
@@ -85,24 +66,26 @@ exports.compress = {
});
}, test.done);
},
+ /*
gzipCustomExt: function(test) {
test.expect(3);
[
'test',
'folder_one/one',
- 'folder_two/two',
+ 'folder_two/two'
].forEach(function(file) {
var expected = path.join('tmp', 'gzipCustomExt', file + '.gz.js');
test.ok(grunt.file.exists(expected), 'should of had a correct extension.');
});
test.done();
},
+ */
deflate: function(test) {
test.expect(3);
grunt.util.async.forEachSeries([
'test.js',
path.join('folder_one', 'one.css'),
- path.join('folder_two', 'two.js'),
+ path.join('folder_two', 'two.js')
], function(file, next) {
var expected = grunt.file.read(path.join('test', 'fixtures', file));
var actual = '';
@@ -122,7 +105,7 @@ exports.compress = {
grunt.util.async.forEachSeries([
'test.js',
path.join('folder_one', 'one.css'),
- path.join('folder_two', 'two.js'),
+ path.join('folder_two', 'two.js')
], function(file, next) {
var expected = grunt.file.read(path.join('test', 'fixtures', file));
var actual = '';
@@ -136,5 +119,5 @@ exports.compress = {
next();
});
}, test.done);
- },
+ }
};

0 comments on commit 94a2db2

Please sign in to comment.