From f9cb571304c417d3179a3c8c45aa405fca13d6bd Mon Sep 17 00:00:00 2001 From: Jakub Pawlowicz Date: Mon, 15 Jun 2015 16:08:33 +0100 Subject: [PATCH] Normalizes anonymous function declarations. the `function ()` with a space is more readable. --- bin/cleancss | 8 +- lib/clean.js | 4 +- lib/imports/inliner.js | 10 +- lib/selectors/optimizers/simple.js | 8 +- lib/text/free-text-processor.js | 6 +- lib/utils/input-source-map-tracker.js | 4 +- test/batch-test.js | 14 +- test/binary-test.js | 14 +- test/integration-test.js | 4 +- test/media-queries-test.js | 38 ++-- test/module-test.js | 32 ++-- .../shorthand-compacting-source-maps-test.js | 2 +- test/protocol-imports-test.js | 180 +++++++++--------- test/selectors/optimizers/simple-test.js | 2 +- test/source-map-test.js | 22 +-- test/text/expressions-processor-test.js | 8 +- test/utils/compatibility-test.js | 18 +- 17 files changed, 187 insertions(+), 187 deletions(-) diff --git a/bin/cleancss b/bin/cleancss index bb224624..40eb0b0d 100755 --- a/bin/cleancss +++ b/bin/cleancss @@ -35,7 +35,7 @@ commands .option('-t, --timeout [seconds]', 'Per connection timeout when fetching remote @imports (defaults to 5 seconds)') .option('-d, --debug', 'Shows debug information (minification time & compression efficiency)'); -commands.on('--help', function() { +commands.on('--help', function () { console.log(' Examples:\n'); console.log(' %> cleancss one.css'); console.log(' %> cleancss -o one-min.css one.css'); @@ -95,10 +95,10 @@ if (commands.args.length > 0) { var stdin = process.openStdin(); stdin.setEncoding('utf-8'); var data = ''; - stdin.on('data', function(chunk) { + stdin.on('data', function (chunk) { data += chunk; }); - stdin.on('end', function() { + stdin.on('end', function () { minify(data); }); } @@ -143,7 +143,7 @@ function outputMap(sourceMap, mapFilename) { function outputFeedback(messages, isError) { var prefix = isError ? '\x1B[31mERROR\x1B[39m:' : 'WARNING:'; - messages.forEach(function(message) { + messages.forEach(function (message) { console.error('%s %s', prefix, message); }); } diff --git a/lib/clean.js b/lib/clean.js index 9f1e766f..6c4afbc8 100644 --- a/lib/clean.js +++ b/lib/clean.js @@ -68,7 +68,7 @@ function presentDirectory(filepath) { return fs.existsSync(filepath) && fs.statSync(filepath).isDirectory(); } -CleanCSS.prototype.minify = function(data, callback) { +CleanCSS.prototype.minify = function (data, callback) { var context = { stats: {}, errors: [], @@ -189,7 +189,7 @@ function minify(context, data) { run(urlsProcessor, 'escape'); run(freeTextProcessor, 'escape'); - run(function() { + run(function () { return selectorsOptimizer.process(data, stringify, function (data) { data = freeTextProcessor.restore(data); data = urlsProcessor.restore(data); diff --git a/lib/imports/inliner.js b/lib/imports/inliner.js index 1a77b57c..c3955891 100644 --- a/lib/imports/inliner.js +++ b/lib/imports/inliner.js @@ -248,7 +248,7 @@ function inlineRemoteResource(importedFile, mediaQuery, context) { } var requestOptions = override(url.parse(importedUrl), context.inliner.request); - get(requestOptions, function(res) { + get(requestOptions, function (res) { if (res.statusCode < 200 || res.statusCode > 399) { return handleError('error ' + res.statusCode); } else if (res.statusCode > 299) { @@ -258,10 +258,10 @@ function inlineRemoteResource(importedFile, mediaQuery, context) { var chunks = []; var parsedUrl = url.parse(importedUrl); - res.on('data', function(chunk) { + res.on('data', function (chunk) { chunks.push(chunk.toString()); }); - res.on('end', function() { + res.on('end', function () { var importedData = chunks.join(''); if (context.rebase) importedData = rewriteUrls(importedData, { toBase: originalUrl }, context); @@ -282,10 +282,10 @@ function inlineRemoteResource(importedFile, mediaQuery, context) { }); }); }) - .on('error', function(res) { + .on('error', function (res) { handleError(res.message); }) - .on('timeout', function() { + .on('timeout', function () { handleError('timeout'); }) .setTimeout(context.inliner.timeout); diff --git a/lib/selectors/optimizers/simple.js b/lib/selectors/optimizers/simple.js index 6feb33fe..2c768e91 100644 --- a/lib/selectors/optimizers/simple.js +++ b/lib/selectors/optimizers/simple.js @@ -68,7 +68,7 @@ function zeroMinifier(name, value) { .replace(/(^|\s)0+([1-9])/g, '$1$2') .replace(/(^|\D)\.0+(\D|$)/g, '$10$2') .replace(/(^|\D)\.0+(\D|$)/g, '$10$2') - .replace(/\.([1-9]*)0+(\D|$)/g, function(match, nonZeroPart, suffix) { + .replace(/\.([1-9]*)0+(\D|$)/g, function (match, nonZeroPart, suffix) { return (nonZeroPart.length > 0 ? '.' : '') + nonZeroPart + suffix; }) .replace(/(^|\D)0\.(\d)/g, '$1.$2'); @@ -101,7 +101,7 @@ function precisionMinifier(_, value, precisionOptions) { return value; return value - .replace(precisionOptions.regexp, function(match, number) { + .replace(precisionOptions.regexp, function (match, number) { return Math.round(parseFloat(number) * precisionOptions.multiplier) / precisionOptions.multiplier + 'px'; }) .replace(/(\d)\.($|\D)/g, '$1$2'); @@ -145,7 +145,7 @@ function colorMininifier(_, value, compatibility) { else return prefix + '#' + color; }) - .replace(/(rgb|rgba|hsl|hsla)\(([^\)]+)\)/g, function(match, colorFunction, colorDef) { + .replace(/(rgb|rgba|hsl|hsla)\(([^\)]+)\)/g, function (match, colorFunction, colorDef) { var tokens = colorDef.split(','); var applies = (colorFunction == 'hsl' && tokens.length == 3) || (colorFunction == 'hsla' && tokens.length == 4) || @@ -289,7 +289,7 @@ function optimizeBody(properties, options) { } } -SimpleOptimizer.prototype.optimize = function(tokens) { +SimpleOptimizer.prototype.optimize = function (tokens) { var self = this; var hasCharset = false; var options = this.options; diff --git a/lib/text/free-text-processor.js b/lib/text/free-text-processor.js index 242be400..27a4aa4d 100644 --- a/lib/text/free-text-processor.js +++ b/lib/text/free-text-processor.js @@ -11,7 +11,7 @@ function FreeTextProcessor(saveWaypoints) { // Strip content tags by replacing them by the a special // marker for further restoring. It's done via string scanning // instead of regexps to speed up the process. -FreeTextProcessor.prototype.escape = function(data) { +FreeTextProcessor.prototype.escape = function (data) { var self = this; var breaksCount; var lastBreakAt; @@ -19,7 +19,7 @@ FreeTextProcessor.prototype.escape = function(data) { var metadata; var saveWaypoints = this.saveWaypoints; - return new QuoteScanner(data).each(function(match, store) { + return new QuoteScanner(data).each(function (match, store) { if (saveWaypoints) { breaksCount = match.split(lineBreak).length - 1; lastBreakAt = match.lastIndexOf(lineBreak); @@ -65,7 +65,7 @@ function normalize(text, data, cursor) { return text; } -FreeTextProcessor.prototype.restore = function(data) { +FreeTextProcessor.prototype.restore = function (data) { var tempData = []; var cursor = 0; diff --git a/lib/utils/input-source-map-tracker.js b/lib/utils/input-source-map-tracker.js index fbf5ebd2..f74e6649 100644 --- a/lib/utils/input-source-map-tracker.js +++ b/lib/utils/input-source-map-tracker.js @@ -110,14 +110,14 @@ function fetch(self, path, onSuccess, onFailure) { onSuccess(chunks.join('')); }); }) - .on('error', function(res) { + .on('error', function (res) { if (errorHandled) return; onFailure(res.message); errorHandled = true; }) - .on('timeout', function() { + .on('timeout', function () { if (errorHandled) return; diff --git a/test/batch-test.js b/test/batch-test.js index 3d8e05c7..bd27cbaa 100644 --- a/test/batch-test.js +++ b/test/batch-test.js @@ -6,16 +6,16 @@ var CleanCSS = require('../index'); var lineBreak = require('os').EOL; -var batchContexts = function() { +var batchContexts = function () { var context = {}; var dir = path.join(__dirname, 'fixtures'); - fs.readdirSync(dir).forEach(function(filename) { + fs.readdirSync(dir).forEach(function (filename) { if (filename.indexOf('.css') == -1 || /min.css$/.exec(filename) || !fs.statSync(path.join(dir, filename)).isFile()) return; var testName = filename.split('.')[0]; context[testName] = { - topic: function() { + topic: function () { var plainPath = path.join(__dirname, 'fixtures', testName + '.css'); var minPath = path.join(__dirname, 'fixtures', testName + '-min.css'); @@ -26,21 +26,21 @@ var batchContexts = function() { }; }, minifying: { - topic: function(data) { + topic: function (data) { var self = this; new CleanCSS({ keepBreaks: true, root: data.root - }).minify(data.plain, function(errors, minified) { + }).minify(data.plain, function (errors, minified) { self.callback(errors, minified.styles, data); }); }, - 'should output right content': function(errors, minified, data) { + 'should output right content': function (errors, minified, data) { var minifiedTokens = minified.split(lineBreak); var preminifiedTokens = data.preminified.split(lineBreak); - minifiedTokens.forEach(function(line, i) { + minifiedTokens.forEach(function (line, i) { assert.equal(line, preminifiedTokens[i]); }); } diff --git a/test/binary-test.js b/test/binary-test.js index 02a26505..d3f345a4 100644 --- a/test/binary-test.js +++ b/test/binary-test.js @@ -9,36 +9,36 @@ var SourceMapConsumer = require('source-map').SourceMapConsumer; var isWindows = process.platform == 'win32'; var lineBreakRegExp = new RegExp(require('os').EOL, 'g'); -var binaryContext = function(options, context) { +var binaryContext = function (options, context) { if (isWindows) return {}; - context.topic = function() { + context.topic = function () { // We add __DIRECT__=1 to force binary into 'non-piped' mode exec('__DIRECT__=1 ./bin/cleancss ' + options, this.callback); }; return context; }; -var pipedContext = function(css, options, context) { +var pipedContext = function (css, options, context) { if (isWindows) return {}; - context.topic = function() { + context.topic = function () { exec('echo "' + css + '" | ./bin/cleancss ' + options, this.callback); }; return context; }; -var unixOnlyContext = function(context) { +var unixOnlyContext = function (context) { return isWindows ? {} : context; }; -var readFile = function(filename) { +var readFile = function (filename) { return fs.readFileSync(filename, { encoding: 'utf-8' }).replace(lineBreakRegExp, ''); }; -var deleteFile = function(filename) { +var deleteFile = function (filename) { if (isWindows) exec('del /q /f ' + filename); else diff --git a/test/integration-test.js b/test/integration-test.js index 8534acfc..e6853113 100644 --- a/test/integration-test.js +++ b/test/integration-test.js @@ -6,7 +6,7 @@ var path = require('path'); var CleanCSS = require('../index'); var lineBreak = require('os').EOL; -var cssContext = function(groups, options) { +var cssContext = function (groups, options) { var context = {}; var clean = function (expected) { @@ -436,7 +436,7 @@ vows.describe('integration tests').addBatch({ 'complex': 'a{width:expression((this.parentNode.innerWidth + this.parentNode.innerHeight) / 2 )}', 'with parentheses': "a{width:expression(this.parentNode.innerText == ')' ? '5px' : '10px' )}", 'open ended (broken)': "a{width:expression(this.parentNode.innerText == }", - 'function call & advanced': 'a{zoom:expression(function(el){el.style.zoom="1"}(this))}' + 'function call & advanced': 'a{zoom:expression(function (el){el.style.zoom="1"}(this))}' }), 'text content': cssContext({ 'normal #1': 'a{content:"."}', diff --git a/test/media-queries-test.js b/test/media-queries-test.js index 13a89430..35ce906e 100644 --- a/test/media-queries-test.js +++ b/test/media-queries-test.js @@ -8,7 +8,7 @@ vows.describe('media queries') 'topic': function () { return new CleanCSS().minify('@media screen{a{color:red}}@media print{div{display:block}}'); }, - 'get merged': function(minified) { + 'get merged': function (minified) { assert.equal(minified.styles, '@media screen{a{color:red}}@media print{div{display:block}}'); } }, @@ -16,7 +16,7 @@ vows.describe('media queries') 'topic': function () { return new CleanCSS().minify('@font-face{font-family:A}@font-face{font-family:B}'); }, - 'get merged': function(minified) { + 'get merged': function (minified) { assert.equal(minified.styles, '@font-face{font-family:A}@font-face{font-family:B}'); } }, @@ -24,7 +24,7 @@ vows.describe('media queries') 'topic': function () { return new CleanCSS().minify('@media screen{a{color:red}div{}}'); }, - 'get merged': function(minified) { + 'get merged': function (minified) { assert.equal(minified.styles, '@media screen{a{color:red}}'); } } @@ -34,7 +34,7 @@ vows.describe('media queries') 'topic': function () { return new CleanCSS().minify('@media screen{a{color:red}}@media screen{div{display:block}}'); }, - 'get merged': function(minified) { + 'get merged': function (minified) { assert.equal(minified.styles, '@media screen{a{color:red}div{display:block}}'); } }, @@ -42,7 +42,7 @@ vows.describe('media queries') 'topic': function () { return new CleanCSS().minify('@media screen{a{color:red}}@media screen{div{display:block}}@media screen{body{width:100%}}'); }, - 'get merged': function(minified) { + 'get merged': function (minified) { assert.equal(minified.styles, '@media screen{a{color:red}div{display:block}body{width:100%}}'); } }, @@ -50,7 +50,7 @@ vows.describe('media queries') 'topic': function () { return new CleanCSS().minify('@media screen{a{color:red}}body{width:100%}.one{height:100px}@media screen{div{display:block}}'); }, - 'get merged': function(minified) { + 'get merged': function (minified) { assert.equal(minified.styles, 'body{width:100%}.one{height:100px}@media screen{a{color:red}div{display:block}}'); } }, @@ -58,7 +58,7 @@ vows.describe('media queries') 'topic': function () { return new CleanCSS().minify('@media screen{a{color:red}}@media (min-width:1024px){body{width:100%}}@media screen{div{display:block}}'); }, - 'get merged': function(minified) { + 'get merged': function (minified) { assert.equal(minified.styles, '@media (min-width:1024px){body{width:100%}}@media screen{a{color:red}div{display:block}}'); } }, @@ -66,7 +66,7 @@ vows.describe('media queries') 'topic': function () { return new CleanCSS().minify('@media screen{a{color:red}}.one{color:#00f}@media screen{div{display:block}}'); }, - 'get merged': function(minified) { + 'get merged': function (minified) { assert.equal(minified.styles, '@media screen{a{color:red}}.one{color:#00f}@media screen{div{display:block}}'); } }, @@ -74,7 +74,7 @@ vows.describe('media queries') 'topic': function () { return new CleanCSS().minify('@media screen{a{color:red}}@media (min-width:1024px){.one{color:#00f}}@media screen{div{display:block}}'); }, - 'get merged': function(minified) { + 'get merged': function (minified) { assert.equal(minified.styles, '@media screen{a{color:red}}@media (min-width:1024px){.one{color:#00f}}@media screen{div{display:block}}'); } }, @@ -82,7 +82,7 @@ vows.describe('media queries') 'topic': function () { return new CleanCSS().minify('@media screen{a{color:red}}@media (min-width:1024px){@media screen{.one{color:#00f}}}@media screen{div{display:block}}'); }, - 'get merged': function(minified) { + 'get merged': function (minified) { assert.equal(minified.styles, '@media screen{a{color:red}}@media (min-width:1024px){@media screen{.one{color:#00f}}}@media screen{div{display:block}}'); } }, @@ -90,7 +90,7 @@ vows.describe('media queries') 'topic': function () { return new CleanCSS().minify('@media screen{a{color:red}}@media (min-width:1024px){p{width:100%}}@media screen{div{display:block}}@media (min-width:1024px){body{height:100%}}'); }, - 'get merged': function(minified) { + 'get merged': function (minified) { assert.equal(minified.styles, '@media screen{a{color:red}div{display:block}}@media (min-width:1024px){p{width:100%}body{height:100%}}'); } }, @@ -98,7 +98,7 @@ vows.describe('media queries') 'topic': function () { return new CleanCSS().minify('@media screen{a{font-size:10px}}@media (min-width:1024px){.one{font:12px Helvetica}}@media screen{div{display:block}}'); }, - 'get merged': function(minified) { + 'get merged': function (minified) { assert.equal(minified.styles, '@media screen{a{font-size:10px}}@media (min-width:1024px){.one{font:12px Helvetica}}@media screen{div{display:block}}'); } }, @@ -106,7 +106,7 @@ vows.describe('media queries') 'topic': function () { return new CleanCSS().minify('@media screen{a{font-size:10px}}@media (min-width:1024px){.one{font-weight:700}}@media screen{div{display:block}}'); }, - 'get merged': function(minified) { + 'get merged': function (minified) { assert.equal(minified.styles, '@media (min-width:1024px){.one{font-weight:700}}@media screen{a{font-size:10px}div{display:block}}'); } }, @@ -114,7 +114,7 @@ vows.describe('media queries') 'topic': function () { return new CleanCSS().minify('@media screen{a{color:red}}@media (min-width:1024px){.one{color:red}}@media screen{div{display:block}}'); }, - 'get merged': function(minified) { + 'get merged': function (minified) { assert.equal(minified.styles, '@media (min-width:1024px){.one{color:red}}@media screen{a{color:red}div{display:block}}'); } }, @@ -122,7 +122,7 @@ vows.describe('media queries') 'topic': function () { return new CleanCSS().minify('@media screen{a{color:red}}.one{color:#000}@media screen{a{color:red}}'); }, - 'get merged': function(minified) { + 'get merged': function (minified) { assert.equal(minified.styles, '.one{color:#000}@media screen{a{color:red}}'); } }, @@ -130,7 +130,7 @@ vows.describe('media queries') 'topic': function () { return new CleanCSS().minify('@media print{a{color:#fff}}@media screen{a{color:red}}.one{color:#000}@media screen{a{color:red}}@media print{a{display:block}}@media print{a{color:#fff}}'); }, - 'get merged': function(minified) { + 'get merged': function (minified) { assert.equal(minified.styles, '.one{color:#000}@media screen{a{color:red}}@media print{a{display:block;color:#fff}}'); } } @@ -140,7 +140,7 @@ vows.describe('media queries') 'topic': function () { return new CleanCSS().minify('@media screen{a{color:red}}@media screen{a{display:block}}'); }, - 'get merged': function(minified) { + 'get merged': function (minified) { assert.equal(minified.styles, '@media screen{a{color:red;display:block}}'); } } @@ -150,7 +150,7 @@ vows.describe('media queries') 'topic': function () { return new CleanCSS().minify('@media screen{a{color:red}}/*! a comment */@media screen{a{display:block}}'); }, - 'get merged': function(minified) { + 'get merged': function (minified) { assert.equal(minified.styles, '/*! a comment */@media screen{a{color:red;display:block}}'); } } @@ -160,7 +160,7 @@ vows.describe('media queries') 'topic': function () { return new CleanCSS({ mediaMerging: false }).minify('@media screen{a{color:red}}@media screen{a{display:block}}'); }, - 'keeps @media intact': function(minified) { + 'keeps @media intact': function (minified) { assert.equal(minified.styles, '@media screen{a{color:red}}@media screen{a{display:block}}'); } } diff --git a/test/module-test.js b/test/module-test.js index 5bdd7c4b..6dd21be9 100644 --- a/test/module-test.js +++ b/test/module-test.js @@ -20,48 +20,48 @@ function sourcesAsHash(sources, resolve) { vows.describe('module tests').addBatch({ 'imported as a function': { - topic: function() { + topic: function () { var css = new CleanCSS(); return css.minify.bind(css); }, - 'should minify CSS correctly': function(minify) { + 'should minify CSS correctly': function (minify) { assert.equal(minify('a{ color: #f00; }').styles, 'a{color:red}'); } }, 'extended via prototype': { - topic: function() { - CleanCSS.prototype.foo = function(data, callback) { + topic: function () { + CleanCSS.prototype.foo = function (data, callback) { callback(null, this.minify(data)); }; new CleanCSS().foo('a{ color: #f00; }', this.callback); }, - 'should minify CSS correctly': function(error, minified) { + 'should minify CSS correctly': function (error, minified) { assert.equal(minified.styles, 'a{color:red}'); }, - teardown: function() { + teardown: function () { delete CleanCSS.prototype.foo; } }, 'with callback passed and no errors': { - topic: function() { + topic: function () { new CleanCSS().minify('a{color:#f00}', this.callback); }, - 'should not set context': function() { + 'should not set context': function () { assert.equal(this instanceof CleanCSS, false); }, - 'should yield no error': function(errors, minified) { + 'should yield no error': function (errors, minified) { /* jshint unused: false */ assert.isNull(errors); }, - 'should yield minified data': function(errors, minified) { + 'should yield minified data': function (errors, minified) { assert.equal(minified.styles, 'a{color:red}'); } }, 'with callback passed and one error': { - topic: function() { + topic: function () { new CleanCSS().minify('@import "missing.css";', this.callback); }, - 'should yield no error and minify': function(errors, minified) { + 'should yield no error and minify': function (errors, minified) { /* jshint unused: false */ assert.lengthOf(errors, 1); } @@ -228,7 +228,7 @@ vows.describe('module tests').addBatch({ 'topic': function () { return new CleanCSS(); }, - 'if both root and output used reasons given': function(minifier) { + 'if both root and output used reasons given': function (minifier) { assert.doesNotThrow(function () { minifier.minify('@import url(/some/fake/file);', function (errors) { assert.isArray(errors); @@ -244,7 +244,7 @@ vows.describe('module tests').addBatch({ }, 'if both root and output used reasons given': function (minifier) { minifier.minify('@import url(/some/fake/file);'); - minifier.minify('@import url(/some/fake/file);', function(errors) { + minifier.minify('@import url(/some/fake/file);', function (errors) { assert.lengthOf(errors, 1); assert.equal(errors[0], 'Broken @import declaration of "/some/fake/file"'); }); @@ -309,10 +309,10 @@ vows.describe('module tests').addBatch({ } }, 'buffer passed in': { - 'topic': function() { + 'topic': function () { return new CleanCSS().minify(new Buffer('@import url(test/fixtures/partials/one.css);')); }, - 'should be processed correctly': function(minified) { + 'should be processed correctly': function (minified) { assert.equal(minified.styles, '.one{color:red}'); } }, diff --git a/test/properties/shorthand-compacting-source-maps-test.js b/test/properties/shorthand-compacting-source-maps-test.js index 341ec674..b7c6d406 100644 --- a/test/properties/shorthand-compacting-source-maps-test.js +++ b/test/properties/shorthand-compacting-source-maps-test.js @@ -44,7 +44,7 @@ vows.describe(optimize) .addBatch({ 'with source map': { topic: 'a{margin-top:10px;margin-bottom:4px;margin-left:5px;margin-right:5px}', - 'into': function(topic) { + 'into': function (topic) { assert.deepEqual(_optimize(topic), [ [ ['margin', false, false, [[1, 2, undefined], [1, 18, undefined], [1, 36, undefined], [1, 52, undefined]]], diff --git a/test/protocol-imports-test.js b/test/protocol-imports-test.js index 0e0c65e6..9af60bb7 100644 --- a/test/protocol-imports-test.js +++ b/test/protocol-imports-test.js @@ -14,102 +14,102 @@ if (process.platform == 'win32') vows.describe('protocol imports').addBatch({ 'of a missing file': { - topic: function() { + topic: function () { this.reqMocks = nock('http://127.0.0.1') .get('/missing.css') .reply(404); new CleanCSS().minify('@import url(http://127.0.0.1/missing.css);a{color:red}', this.callback); }, - 'should raise error': function(errors, minified) { + 'should raise error': function (errors, minified) { assert.lengthOf(errors, 1); }, - 'should ignore @import': function(errors, minified) { + 'should ignore @import': function (errors, minified) { assert.equal(minified.styles, '@import url(http://127.0.0.1/missing.css);a{color:red}'); }, - teardown: function() { + teardown: function () { assert.isTrue(this.reqMocks.isDone()); nock.cleanAll(); } }, 'of an existing file': { - topic: function() { + topic: function () { this.reqMocks = nock('http://127.0.0.1') .get('/present.css') .reply(200, 'p{font-size:13px}'); new CleanCSS().minify('@import url(http://127.0.0.1/present.css);a{color:red}', this.callback); }, - 'should not raise errors': function(errors, minified) { + 'should not raise errors': function (errors, minified) { assert.isNull(errors); }, - 'should process @import': function(errors, minified) { + 'should process @import': function (errors, minified) { assert.equal(minified.styles, 'p{font-size:13px}a{color:red}'); }, - teardown: function() { + teardown: function () { assert.isTrue(this.reqMocks.isDone()); nock.cleanAll(); } }, 'of an existing file with spaces in path': { - topic: function() { + topic: function () { this.reqMocks = nock('http://fonts.googleapis.com') .get('/css?family=Oleo%20Script%20Swash%20Caps') .reply(200, 'p{font-size:13px}'); new CleanCSS().minify('@import url(\'//fonts.googleapis.com/css?family=Oleo Script Swash Caps\');', this.callback); }, - 'should not raise errors': function(errors, minified) { + 'should not raise errors': function (errors, minified) { assert.isNull(errors); }, - 'should process @import': function(errors, minified) { + 'should process @import': function (errors, minified) { assert.equal(minified.styles, 'p{font-size:13px}'); }, - teardown: function() { + teardown: function () { assert.isTrue(this.reqMocks.isDone()); nock.cleanAll(); } }, 'of an existing file via HTTPS': { - topic: function() { + topic: function () { this.reqMocks = nock('https://127.0.0.1') .get('/present.css') .reply(200, 'p{font-size:13px}'); new CleanCSS().minify('@import url(https://127.0.0.1/present.css);a{color:red}', this.callback); }, - 'should not raise errors': function(errors, minified) { + 'should not raise errors': function (errors, minified) { assert.isNull(errors); }, - 'should process @import': function(errors, minified) { + 'should process @import': function (errors, minified) { assert.equal(minified.styles, 'p{font-size:13px}a{color:red}'); }, - teardown: function() { + teardown: function () { assert.isTrue(this.reqMocks.isDone()); nock.cleanAll(); } }, 'of an existing file with media': { - topic: function() { + topic: function () { this.reqMocks = nock('http://127.0.0.1') .get('/present.css') .reply(200, 'p{font-size:13px}'); new CleanCSS().minify('@import url(http://127.0.0.1/present.css) screen;a{color:red}', this.callback); }, - 'should not raise errors': function(errors, minified) { + 'should not raise errors': function (errors, minified) { assert.isNull(errors); }, - 'should process @import': function(errors, minified) { + 'should process @import': function (errors, minified) { assert.equal(minified.styles, '@media screen{p{font-size:13px}}a{color:red}'); }, - teardown: function() { + teardown: function () { assert.isTrue(this.reqMocks.isDone()); nock.cleanAll(); } }, 'of an existing file with dependencies': { - topic: function() { + topic: function () { this.reqMocks1 = nock('http://127.0.0.1') .get('/present.css') .reply(200, '@import url(/vendor/reset.css);@import url(https://assets.127.0.0.1/base.css);p{font-size:13px}') @@ -121,20 +121,20 @@ vows.describe('protocol imports').addBatch({ new CleanCSS().minify('@import url(http://127.0.0.1/present.css);a{color:red}', this.callback); }, - 'should not raise errors': function(errors, minified) { + 'should not raise errors': function (errors, minified) { assert.isNull(errors); }, - 'should process @import': function(errors, minified) { + 'should process @import': function (errors, minified) { assert.equal(minified.styles, 'body{margin:0}div{padding:0}p{font-size:13px}a{color:red}'); }, - teardown: function() { + teardown: function () { assert.isTrue(this.reqMocks1.isDone()); assert.isTrue(this.reqMocks2.isDone()); nock.cleanAll(); } }, 'of an existing file with relative dependencies': { - topic: function() { + topic: function () { this.reqMocks = nock('http://127.0.0.1') .get('/nested/present.css') .reply(200, '@import url(../vendor/reset.css);p{font-size:13px}') @@ -143,19 +143,19 @@ vows.describe('protocol imports').addBatch({ new CleanCSS().minify('@import url(http://127.0.0.1/nested/present.css);a{color:red}', this.callback); }, - 'should not raise errors': function(errors, minified) { + 'should not raise errors': function (errors, minified) { assert.isNull(errors); }, - 'should process @import': function(errors, minified) { + 'should process @import': function (errors, minified) { assert.equal(minified.styles, 'body{margin:0}p{font-size:13px}a{color:red}'); }, - teardown: function() { + teardown: function () { assert.isTrue(this.reqMocks.isDone()); nock.cleanAll(); } }, 'of an existing file missing relative dependency': { - topic: function() { + topic: function () { this.reqMocks = nock('http://127.0.0.1') .get('/nested/present.css') .reply(200, '@import url(../missing.css);p{font-size:13px}') @@ -164,39 +164,39 @@ vows.describe('protocol imports').addBatch({ new CleanCSS().minify('@import url(http://127.0.0.1/nested/present.css);a{color:red}', this.callback); }, - 'should not raise errors': function(errors, minified) { + 'should not raise errors': function (errors, minified) { assert.lengthOf(errors, 1); assert.equal(errors[0], 'Broken @import declaration of "http://127.0.0.1/missing.css" - error 404'); }, - 'should process @import': function(errors, minified) { + 'should process @import': function (errors, minified) { assert.equal(minified.styles, '@import url(http://127.0.0.1/missing.css);p{font-size:13px}a{color:red}'); }, - teardown: function() { + teardown: function () { assert.isTrue(this.reqMocks.isDone()); nock.cleanAll(); } }, 'of an existing file with URLs to rebase': { - topic: function() { + topic: function () { this.reqMocks = nock('http://127.0.0.1') .get('/urls.css') .reply(200, 'a{background:url(test.png)}'); new CleanCSS().minify('@import url(http://127.0.0.1/urls.css);', this.callback); }, - 'should not raise errors': function(errors, minified) { + 'should not raise errors': function (errors, minified) { assert.isNull(errors); }, - 'should process @import': function(errors, minified) { + 'should process @import': function (errors, minified) { assert.equal(minified.styles, 'a{background:url(http://127.0.0.1/test.png)}'); }, - teardown: function() { + teardown: function () { assert.isTrue(this.reqMocks.isDone()); nock.cleanAll(); } }, 'of an existing file with relative URLs to rebase': { - topic: function() { + topic: function () { this.reqMocks = nock('http://127.0.0.1') .get('/base.css') .reply(200, '@import url(deeply/nested/urls.css);') @@ -205,19 +205,19 @@ vows.describe('protocol imports').addBatch({ new CleanCSS().minify('@import url(http://127.0.0.1/base.css);', this.callback); }, - 'should not raise errors': function(errors, minified) { + 'should not raise errors': function (errors, minified) { assert.isNull(errors); }, - 'should process @import': function(errors, minified) { + 'should process @import': function (errors, minified) { assert.equal(minified.styles, 'a{background:url(http://127.0.0.1/deeply/images/test.png)}'); }, - teardown: function() { + teardown: function () { assert.isTrue(this.reqMocks.isDone()); nock.cleanAll(); } }, 'of an existing file with relative URLs and rebase turned off': { - topic: function() { + topic: function () { this.reqMocks = nock('http://127.0.0.1') .get('/base.css') .reply(200, '@import url(deeply/nested/urls.css);') @@ -226,31 +226,31 @@ vows.describe('protocol imports').addBatch({ new CleanCSS({ rebase: false }).minify('@import url(http://127.0.0.1/base.css);', this.callback); }, - 'should not raise errors': function(errors, minified) { + 'should not raise errors': function (errors, minified) { assert.isNull(errors); }, - 'should process @import': function(errors, minified) { + 'should process @import': function (errors, minified) { assert.equal(minified.styles, 'a{background:url(../images/test.png)}'); }, - teardown: function() { + teardown: function () { assert.isTrue(this.reqMocks.isDone()); nock.cleanAll(); } }, 'of an unreachable domain': { - topic: function() { + topic: function () { new CleanCSS().minify('@import url(http://0.0.0.0/custom.css);a{color:red}', this.callback); }, - 'should not raise errors': function(errors, minified) { + 'should not raise errors': function (errors, minified) { assert.lengthOf(errors, 1); assert.include(errors[0], 'Broken @import declaration of "http://0.0.0.0/custom.css"'); }, - 'should process @import': function(errors, minified) { + 'should process @import': function (errors, minified) { assert.equal(minified.styles, '@import url(http://0.0.0.0/custom.css);a{color:red}'); } }, 'of a 30x response with absolute URL': { - topic: function() { + topic: function () { this.reqMocks = nock('http://127.0.0.1') .get('/moved.css') .reply(301, '', { 'Location': 'http://127.0.0.1/present.css' }) @@ -259,19 +259,19 @@ vows.describe('protocol imports').addBatch({ new CleanCSS().minify('@import url(http://127.0.0.1/moved.css);a{color:red}', this.callback); }, - 'should not raise errors': function(errors, minified) { + 'should not raise errors': function (errors, minified) { assert.isNull(errors); }, - 'should process @import': function(errors, minified) { + 'should process @import': function (errors, minified) { assert.equal(minified.styles, 'body{margin:0}a{color:red}'); }, - teardown: function() { + teardown: function () { assert.isTrue(this.reqMocks.isDone()); nock.cleanAll(); } }, 'of a 30x response with relative URL': { - topic: function() { + topic: function () { this.reqMocks = nock('http://127.0.0.1') .get('/moved.css') .reply(301, '', { 'Location': '/present.css' }) @@ -280,19 +280,19 @@ vows.describe('protocol imports').addBatch({ new CleanCSS().minify('@import url(http://127.0.0.1/moved.css);a{color:red}', this.callback); }, - 'should not raise errors': function(errors, minified) { + 'should not raise errors': function (errors, minified) { assert.isNull(errors); }, - 'should process @import': function(errors, minified) { + 'should process @import': function (errors, minified) { assert.equal(minified.styles, 'body{margin:0}a{color:red}'); }, - teardown: function() { + teardown: function () { assert.isTrue(this.reqMocks.isDone()); nock.cleanAll(); } }, 'of a cyclical reference response': { - topic: function() { + topic: function () { this.reqMocks = nock('http://127.0.0.1') .get('/one.css') .reply(200, '@import url(/two.css);div{padding:0}') @@ -301,76 +301,76 @@ vows.describe('protocol imports').addBatch({ new CleanCSS().minify('@import url(http://127.0.0.1/one.css);a{color:red}', this.callback); }, - 'should not raise errors': function(errors, minified) { + 'should not raise errors': function (errors, minified) { assert.isNull(errors); }, - 'should process @import': function(errors, minified) { + 'should process @import': function (errors, minified) { assert.equal(minified.styles, 'body{margin:0}div{padding:0}a{color:red}'); }, - teardown: function() { + teardown: function () { assert.isTrue(this.reqMocks.isDone()); nock.cleanAll(); } }, 'of a resource without protocol': { - topic: function() { + topic: function () { this.reqMocks = nock('http://127.0.0.1') .get('/no-protocol.css') .reply(200, 'div{padding:0}'); new CleanCSS().minify('@import url(//127.0.0.1/no-protocol.css);a{color:red}', this.callback); }, - 'should not raise errors': function(errors, minified) { + 'should not raise errors': function (errors, minified) { assert.isNull(errors); }, - 'should process @import': function(errors, minified) { + 'should process @import': function (errors, minified) { assert.equal(minified.styles, 'div{padding:0}a{color:red}'); }, - teardown: function() { + teardown: function () { assert.isTrue(this.reqMocks.isDone()); nock.cleanAll(); } }, 'of a resource without protocol with rebase': { - topic: function() { + topic: function () { this.reqMocks = nock('http://127.0.0.1') .get('/no-protocol.css') .reply(200, 'a{background:url(image.png)}'); new CleanCSS().minify('@import url(//127.0.0.1/no-protocol.css);', this.callback); }, - 'should not raise errors': function(errors, minified) { + 'should not raise errors': function (errors, minified) { assert.isNull(errors); }, - 'should process @import': function(errors, minified) { + 'should process @import': function (errors, minified) { assert.equal(minified.styles, 'a{background:url(//127.0.0.1/image.png)}'); }, - teardown: function() { + teardown: function () { assert.isTrue(this.reqMocks.isDone()); nock.cleanAll(); } }, 'of a resource without protocol with rebase to another domain': { - topic: function() { + topic: function () { this.reqMocks = nock('http://127.0.0.1') .get('/no-protocol.css') .reply(200, 'a{background:url(//127.0.0.2/image.png)}'); new CleanCSS().minify('@import url(http://127.0.0.1/no-protocol.css);', this.callback); }, - 'should not raise errors': function(errors, minified) { + 'should not raise errors': function (errors, minified) { assert.isNull(errors); }, - 'should process @import': function(errors, minified) { + 'should process @import': function (errors, minified) { assert.equal(minified.styles, 'a{background:url(//127.0.0.2/image.png)}'); }, - teardown: function() { + teardown: function () { assert.isTrue(this.reqMocks.isDone()); nock.cleanAll(); } }, 'of a resource available via POST only': { - topic: function() { + topic: function () { this.reqMocks = nock('http://127.0.0.1') .post('/computed.css') .reply(200, 'div{padding:0}'); @@ -383,19 +383,19 @@ vows.describe('protocol imports').addBatch({ } }).minify('@import url(http://127.0.0.1/computed.css);a{color:red}', this.callback); }, - 'should not raise errors': function(errors, minified) { + 'should not raise errors': function (errors, minified) { assert.isNull(errors); }, - 'should process @import': function(errors, minified) { + 'should process @import': function (errors, minified) { assert.equal(minified.styles, 'div{padding:0}a{color:red}'); }, - teardown: function() { + teardown: function () { assert.isTrue(this.reqMocks.isDone()); nock.cleanAll(); } }, 'of a remote resource mixed with local ones': { - topic: function() { + topic: function () { var source = '@import url(http://127.0.0.1/remote.css);@import url(test/fixtures/partials/one.css);'; this.reqMocks = nock('http://127.0.0.1') .get('/remote.css') @@ -403,19 +403,19 @@ vows.describe('protocol imports').addBatch({ new CleanCSS().minify(source, this.callback); }, - 'should not raise errors': function(errors, minified) { + 'should not raise errors': function (errors, minified) { assert.isNull(errors); }, - 'should process @import': function(errors, minified) { + 'should process @import': function (errors, minified) { assert.equal(minified.styles, 'div{padding:0}.one{color:red}'); }, - teardown: function() { + teardown: function () { assert.isTrue(this.reqMocks.isDone()); nock.cleanAll(); } }, 'of a remote resource mixed with local ones but no callback': { - topic: function() { + topic: function () { var source = '@import url(test/fixtures/partials/one.css);@import url(http://127.0.0.1/remote.css);'; this.reqMocks = nock('http://127.0.0.1') .get('/remote.css') @@ -433,13 +433,13 @@ vows.describe('protocol imports').addBatch({ 'should process @import': function (error, minified) { assert.equal(minified.styles, '.one{color:red}'); }, - teardown: function() { + teardown: function () { assert.isFalse(this.reqMocks.isDone()); nock.cleanAll(); } }, 'of a remote file that imports relative stylesheets': { - topic: function() { + topic: function () { var source = '@import url(http://127.0.0.1/test/folder/remote.css);'; this.reqMocks = nock('http://127.0.0.1') .get('/test/folder/remote.css') @@ -457,22 +457,22 @@ vows.describe('protocol imports').addBatch({ 'should process @import': function (error, minified) { assert.equal(minified.styles, 'div{padding:0}a{color:red}'); }, - teardown: function() { + teardown: function () { assert.isTrue(this.reqMocks.isDone()); nock.cleanAll(); } } }).addBatch({ 'of a timed out response': { - topic: function() { + topic: function () { nock.enableNetConnect(); var self = this; var timeout = 100; - this.server = http.createServer(function(req, res) { - setTimeout(function() {}, timeout * 2); + this.server = http.createServer(function (req, res) { + setTimeout(function () {}, timeout * 2); }); - this.server.listen(port, function() { + this.server.listen(port, function () { new CleanCSS({ inliner: { timeout: timeout @@ -481,14 +481,14 @@ vows.describe('protocol imports').addBatch({ }); enableDestroy(self.server); }, - 'should raise errors': function(errors, minified) { + 'should raise errors': function (errors, minified) { assert.lengthOf(errors, 1); assert.equal(errors[0], 'Broken @import declaration of "http://localhost:' + port + '/timeout.css" - timeout'); }, - 'should process @import': function(errors, minified) { + 'should process @import': function (errors, minified) { assert.equal(minified.styles, '@import url(http://localhost:' + port + '/timeout.css);a{color:red}'); }, - teardown: function() { + teardown: function () { this.server.destroy(); nock.disableNetConnect(); } diff --git a/test/selectors/optimizers/simple-test.js b/test/selectors/optimizers/simple-test.js index 17c478de..f1570c7e 100644 --- a/test/selectors/optimizers/simple-test.js +++ b/test/selectors/optimizers/simple-test.js @@ -45,7 +45,7 @@ function propertyContext(group, specs, options) { tokens[0][2].map(function (property) { return typeof property == 'string' ? property : - property.map(function(t) { return t[0]; }); + property.map(function (t) { return t[0]; }); }) : null; diff --git a/test/source-map-test.js b/test/source-map-test.js index d682f64e..7f474c9c 100644 --- a/test/source-map-test.js +++ b/test/source-map-test.js @@ -49,7 +49,7 @@ vows.describe('source-map') 'topic': function () { return new CleanCSS({ sourceMap: true }).minify('/*! a */div[data-id=" abc "] { color:red; }'); }, - 'has 3 mappings': function(minified) { + 'has 3 mappings': function (minified) { assert.lengthOf(minified.sourceMap._mappings._array, 3); }, 'has selector mapping': function (minified) { @@ -90,7 +90,7 @@ vows.describe('source-map') 'topic': function () { return new CleanCSS({ sourceMap: true }).minify('@media screen {\n@font-face \n{ \nfont-family: test; } }'); }, - 'has 4 mappings': function(minified) { + 'has 4 mappings': function (minified) { assert.lengthOf(minified.sourceMap._mappings._array, 4); }, 'has `@media` mapping': function (minified) { @@ -142,7 +142,7 @@ vows.describe('source-map') 'topic': function () { return new CleanCSS({ sourceMap: true, keepBreaks: true }).minify('@media screen { a{color:red} p {color:blue} }div{color:pink}'); }, - 'has 10 mappings': function(minified) { + 'has 10 mappings': function (minified) { assert.lengthOf(minified.sourceMap._mappings._array, 10); }, 'has `@media` mapping': function (minified) { @@ -260,7 +260,7 @@ vows.describe('source-map') 'topic': function () { return new CleanCSS({ sourceMap: true }).minify('@-webkit-keyframes frames {\n 0% {\n border: 1px;\n }\n 100% {\n border: 3px;\n }\n}'); }, - 'has 7 mappings': function(minified) { + 'has 7 mappings': function (minified) { assert.lengthOf(minified.sourceMap._mappings._array, 7); }, 'has `@keframes` mapping': function (minified) { @@ -345,7 +345,7 @@ vows.describe('source-map') 'topic': function () { return new CleanCSS({ sourceMap: true }).minify('/* COMMENT 1 */\n/* COMMENT 2 */\ndiv{color:red}'); }, - 'has 3 mappings': function(minified) { + 'has 3 mappings': function (minified) { assert.lengthOf(minified.sourceMap._mappings._array, 3); }, 'has `div`_ mapping': function (minified) { @@ -887,7 +887,7 @@ vows.describe('source-map') 'has mapping': function (errors, minified) { assert.isDefined(minified.sourceMap); }, - 'raises an error': function(errors, _) { + 'raises an error': function (errors, _) { assert.lengthOf(errors, 1); assert.equal(errors[0], 'Broken source map at "http://127.0.0.1/remote.css.map" - 404'); }, @@ -897,13 +897,13 @@ vows.describe('source-map') } }, 'timed out response for external source map': { - topic: function() { + topic: function () { nock.enableNetConnect(); var self = this; var timeout = 100; - this.server = http.createServer(function(req, res) { + this.server = http.createServer(function (req, res) { switch (req.url) { case '/remote.css': res.writeHead(200); @@ -911,10 +911,10 @@ vows.describe('source-map') res.end(); break; case '/remote.css.map': - setTimeout(function() {}, timeout * 2); + setTimeout(function () {}, timeout * 2); } }); - this.server.listen(port, '127.0.0.1', function() { + this.server.listen(port, '127.0.0.1', function () { new CleanCSS({ sourceMap: true, inliner: { timeout: timeout } }) .minify('@import url(http://127.0.0.1:' + port + '/remote.css);', self.callback); }); @@ -923,7 +923,7 @@ vows.describe('source-map') 'has mapping': function (errors, minified) { assert.isDefined(minified.sourceMap); }, - 'raises an error': function(errors, _) { + 'raises an error': function (errors, _) { assert.lengthOf(errors, 1); assert.include(errors[0], 'Broken source map at "http://127.0.0.1:' + port + '/remote.css.map"'); }, diff --git a/test/text/expressions-processor-test.js b/test/text/expressions-processor-test.js index 22500a45..97760009 100644 --- a/test/text/expressions-processor-test.js +++ b/test/text/expressions-processor-test.js @@ -72,14 +72,14 @@ vows.describe(ExpressionsProcessor) 'a{width:expression(this.parentNode.innerText == }' ], 'function call & advanced': [ - 'a{zoom:expression(function(el){el.style.zoom="1"}(this))}', + 'a{zoom:expression(function (el){el.style.zoom="1"}(this))}', 'a{zoom:__ESCAPED_EXPRESSION_CLEAN_CSS0__}', - 'a{zoom:expression(function(el){el.style.zoom="1"}(this))}' + 'a{zoom:expression(function (el){el.style.zoom="1"}(this))}' ], 'with more properties': [ - 'a{color:red;zoom:expression(function(el){el.style.zoom="1"}(this));display:block}', + 'a{color:red;zoom:expression(function (el){el.style.zoom="1"}(this));display:block}', 'a{color:red;zoom:__ESCAPED_EXPRESSION_CLEAN_CSS0__;display:block}', - 'a{color:red;zoom:expression(function(el){el.style.zoom="1"}(this));display:block}' + 'a{color:red;zoom:expression(function (el){el.style.zoom="1"}(this));display:block}' ] }) ) diff --git a/test/utils/compatibility-test.js b/test/utils/compatibility-test.js index c72cbd61..1be90772 100644 --- a/test/utils/compatibility-test.js +++ b/test/utils/compatibility-test.js @@ -8,7 +8,7 @@ vows.describe(Compatibility) 'topic': function () { return new Compatibility({}).toOptions(); }, - 'gets default options': function(options) { + 'gets default options': function (options) { assert.isTrue(options.colors.opacity); assert.isTrue(options.properties.colors); assert.isFalse(options.properties.backgroundClipMerging); @@ -36,7 +36,7 @@ vows.describe(Compatibility) 'topic': function () { return new Compatibility().toOptions(); }, - 'gets default options': function(options) { + 'gets default options': function (options) { assert.deepEqual(options, new Compatibility({}).toOptions()); } }, @@ -44,7 +44,7 @@ vows.describe(Compatibility) 'topic': function () { return new Compatibility({ units: { rem: false, vmax: false }, properties: { prefix: true } }).toOptions(); }, - 'gets merged options': function(options) { + 'gets merged options': function (options) { assert.isTrue(options.colors.opacity); assert.isFalse(options.properties.backgroundClipMerging); assert.isFalse(options.properties.backgroundOriginMerging); @@ -73,7 +73,7 @@ vows.describe(Compatibility) 'topic': function () { return new Compatibility('ie8').toOptions(); }, - 'gets template options': function(options) { + 'gets template options': function (options) { assert.isFalse(options.colors.opacity); assert.isFalse(options.properties.backgroundClipMerging); assert.isFalse(options.properties.backgroundOriginMerging); @@ -101,7 +101,7 @@ vows.describe(Compatibility) 'topic': function () { return new Compatibility('ie7').toOptions(); }, - 'gets template options': function(options) { + 'gets template options': function (options) { assert.isFalse(options.colors.opacity); assert.isFalse(options.properties.backgroundClipMerging); assert.isFalse(options.properties.backgroundOriginMerging); @@ -129,7 +129,7 @@ vows.describe(Compatibility) 'topic': function () { return new Compatibility('').toOptions(); }, - 'gets default options': function(options) { + 'gets default options': function (options) { assert.deepEqual(options, new Compatibility({}).toOptions()); } } @@ -139,7 +139,7 @@ vows.describe(Compatibility) 'topic': function () { return new Compatibility('ie8,-properties.iePrefixHack,+colors.opacity').toOptions(); }, - 'gets calculated options': function(options) { + 'gets calculated options': function (options) { assert.isTrue(options.colors.opacity); assert.isFalse(options.properties.backgroundClipMerging); assert.isFalse(options.properties.backgroundOriginMerging); @@ -167,7 +167,7 @@ vows.describe(Compatibility) 'topic': function () { return new Compatibility('+properties.iePrefixHack').toOptions(); }, - 'gets calculated options': function(options) { + 'gets calculated options': function (options) { assert.isTrue(options.colors.opacity); assert.isTrue(options.properties.colors); assert.isFalse(options.properties.backgroundClipMerging); @@ -195,7 +195,7 @@ vows.describe(Compatibility) 'topic': function () { return new Compatibility('+properties.iePrefixHack,-units.rem').toOptions(); }, - 'gets calculated options': function(options) { + 'gets calculated options': function (options) { assert.isTrue(options.colors.opacity); assert.isTrue(options.properties.colors); assert.isFalse(options.properties.backgroundClipMerging); -- 2.34.1