var context = {};
var dir = path.join(__dirname, 'data');
fs.readdirSync(dir).forEach(function(filename) {
- if (/min.css$/.exec(filename) || !fs.statSync(path.join(dir, filename)).isFile()) return;
+ if (/min.css$/.exec(filename) || !fs.statSync(path.join(dir, filename)).isFile())
+ return;
var testName = filename.split('.')[0];
context[testName] = {
bigcss = require('fs').readFileSync(require('path').join(__dirname, 'data', 'big.css'), 'utf8');
if (!process.hrtime) {
- console.log("process.hrtime() (node > 0.7.6) is required for benchmarking");
+ console.log('process.hrtime() (node.js > 0.7.6) is required for benchmarking');
process.exit(1);
}
cleanCSS.process(bigcss, { debug: true });
var itTook = process.hrtime(start);
-console.log('complete minification: %d ms', 1000 * itTook[0] + itTook[1] / 1000000.0);
\ No newline at end of file
+console.log('complete minification: %d ms', 1000 * itTook[0] + itTook[1] / 1000000.0);
context.topic = function() {
// We add __DIRECT__=1 to force binary into 'non-piped' mode
- exec("__DIRECT__=1 ./bin/cleancss " + options, this.callback);
+ exec('__DIRECT__=1 ./bin/cleancss ' + options, this.callback);
};
return context;
};
return {};
context.topic = function() {
- exec("echo \"" + css + "\" | ./bin/cleancss " + options, this.callback);
+ exec('echo "' + css + '" | ./bin/cleancss ' + options, this.callback);
};
return context;
};
assert.equal(stdout, minimized);
}
}),
- 'to file': binaryContext('-o reset-min.css ./test/data/reset.css', {
+ 'to file': binaryContext('-o ./reset-min.css ./test/data/reset.css', {
'should give no output': function(error, stdout) {
assert.equal(stdout, '');
},
},
teardown: function() {
if (isWindows)
- exec('del /q /f reset-min.css');
+ exec('del /q /f ./reset-min.css');
else
- exec('rm reset-min.css');
+ exec('rm ./reset-min.css');
}
})
-});
\ No newline at end of file
+});
for (var g in groups) {
var transformation = groups[g];
- if (typeof transformation == 'string') transformation = [transformation, transformation];
- if (!transformation[0].push) {
+ if (typeof transformation == 'string')
+ transformation = [transformation, transformation];
+ if (!transformation[0].push)
transformation = [[transformation[0], transformation[1]]];
- }
for (var i = 0, c = transformation.length; i < c; i++) {
context[g + ' #' + (i + 1)] = {