From: Jakub Pawlowicz Date: Tue, 16 Dec 2014 20:22:51 +0000 (+0000) Subject: Moves 'test/data' and 'test/data-bench' to 'test/fixtures'. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=398d6f7b3c60dd0ca2e826e5f578dc64bd5902ef;p=clean-css.git Moves 'test/data' and 'test/data-bench' to 'test/fixtures'. --- diff --git a/README.md b/README.md index f50a156e..4da789b5 100644 --- a/README.md +++ b/README.md @@ -186,7 +186,7 @@ First clone the source, then run: If you wonder where to add tests, go for: * `test/unit-test.js` if it's a simple scenario -* `test/data/...` if it's a complex scenario (just add two files, input and expected output) +* `test/fixtures/...` if it's a complex scenario (just add two files, input and expected output) * `test/binary-test.js` if it's related to `bin/cleancss` binary * `test/module-test.js` if it's related to importing `clean-css` as a module * `test/protocol-imports-test.js` if it fixes anything related to protocol `@import`s diff --git a/test/batch-test.js b/test/batch-test.js index 27cc61a0..3d8e05c7 100644 --- a/test/batch-test.js +++ b/test/batch-test.js @@ -8,7 +8,7 @@ var lineBreak = require('os').EOL; var batchContexts = function() { var context = {}; - var dir = path.join(__dirname, 'data'); + var dir = path.join(__dirname, 'fixtures'); fs.readdirSync(dir).forEach(function(filename) { if (filename.indexOf('.css') == -1 || /min.css$/.exec(filename) || !fs.statSync(path.join(dir, filename)).isFile()) return; @@ -16,8 +16,8 @@ var batchContexts = function() { context[testName] = { topic: function() { - var plainPath = path.join(__dirname, 'data', testName + '.css'); - var minPath = path.join(__dirname, 'data', testName + '-min.css'); + var plainPath = path.join(__dirname, 'fixtures', testName + '.css'); + var minPath = path.join(__dirname, 'fixtures', testName + '-min.css'); return { plain: fs.readFileSync(plainPath, 'utf-8'), diff --git a/test/bench.js b/test/bench.js index a96ea520..2acabd5c 100644 --- a/test/bench.js +++ b/test/bench.js @@ -1,7 +1,7 @@ var CleanCSS = require('../index'); var path = require('path'); -var benchDir = path.join(__dirname, 'data-bench'); +var benchDir = path.join(__dirname, 'fixtures', 'bench'); var cssData = require('fs').readFileSync(path.join(benchDir, 'complex.css'), 'utf8'); var total = 0; diff --git a/test/binary-test.js b/test/binary-test.js index 9330af62..b4f5f4e8 100644 --- a/test/binary-test.js +++ b/test/binary-test.js @@ -96,12 +96,12 @@ exports.commandsSuite = vows.describe('binary commands').addBatch({ assert.include(stderr, 'Efficiency: 25%'); } }), - 'piped with debug info on inlining': pipedContext('@import url(test/data/imports-min.css);', '-d', { + 'piped with debug info on inlining': pipedContext('@import url(test/fixtures/imports-min.css);', '-d', { 'should output inlining info': function(error, stdout, stderr) { - assert.include(stderr, path.join(process.cwd(), 'test/data/imports-min.css')); + assert.include(stderr, path.join(process.cwd(), 'test/fixtures/imports-min.css')); } }), - 'piped with correct debug info on inlining': pipedContext('@import url(test/data/imports.css);', '-d', { + 'piped with correct debug info on inlining': pipedContext('@import url(test/fixtures/imports.css);', '-d', { 'should output correct info': function(error, stdout, stderr) { assert.include(stderr, 'Original: 120 bytes'); assert.include(stderr, 'Minified: 86 bytes'); @@ -130,35 +130,35 @@ exports.commandsSuite = vows.describe('binary commands').addBatch({ assert.equal(stdout, 'a{color:red}p{color:red}'); } }), - 'no relative to path': binaryContext('./test/data/partials-absolute/base.css', { + 'no relative to path': binaryContext('./test/fixtures/partials-absolute/base.css', { 'should not be able to resolve it fully': function(error, stdout, stderr) { assert.isEmpty(stdout); assert.notEqual(error, null); assert.notEqual(stderr, ''); } }), - 'relative to path': binaryContext('-r ./test/data ./test/data/partials-absolute/base.css', { + 'relative to path': binaryContext('-r ./test/fixtures ./test/fixtures/partials-absolute/base.css', { 'should be able to resolve it': function(error, stdout) { assert.equal(stdout, '.base2{border-width:0}.sub{padding:0}.base{margin:0}'); } }), - 'from source': binaryContext('./test/data/reset.css', { + 'from source': binaryContext('./test/fixtures/reset.css', { 'should minimize': function(error, stdout) { - var minimized = fs.readFileSync('./test/data/reset-min.css', 'utf-8').replace(lineBreakRegExp, ''); + var minimized = fs.readFileSync('./test/fixtures/reset-min.css', 'utf-8').replace(lineBreakRegExp, ''); assert.equal(stdout, minimized); } }), - 'from multiple sources': binaryContext('./test/data/partials/one.css ./test/data/partials/five.css', { + 'from multiple sources': binaryContext('./test/fixtures/partials/one.css ./test/fixtures/partials/five.css', { 'should minimize all': function(error, stdout) { assert.equal(stdout, '.one{color:red}.five{background:url(data:image/jpeg;base64,/9j/)}'); } }), - 'to file': binaryContext('-o ./reset1-min.css ./test/data/reset.css', { + 'to file': binaryContext('-o ./reset1-min.css ./test/fixtures/reset.css', { 'should give no output': function(error, stdout) { assert.isEmpty(stdout); }, 'should minimize': function() { - var preminified = readFile('./test/data/reset-min.css'); + var preminified = readFile('./test/fixtures/reset-min.css'); var minified = readFile('./reset1-min.css'); assert.equal(minified, preminified); }, @@ -166,33 +166,33 @@ exports.commandsSuite = vows.describe('binary commands').addBatch({ deleteFile('./reset1-min.css'); } }), - 'disable @import': binaryContext('-s ./test/data/imports.css', { + 'disable @import': binaryContext('-s ./test/fixtures/imports.css', { 'should disable the import processing': function(error, stdout) { assert.equal(stdout, '@import url(./partials/one.css);@import url(./partials/two.css);.imports{color:#000}'); } }), 'relative image paths': { - 'no root & output': binaryContext('./test/data/partials-relative/base.css', { + 'no root & output': binaryContext('./test/fixtures/partials-relative/base.css', { 'should leave paths': function(error, stdout) { assert.equal(stdout, 'a{background:url(../partials/extra/down.gif) no-repeat}'); } }), - 'root but no output': binaryContext('-r ./test ./test/data/partials-relative/base.css', { + 'root but no output': binaryContext('-r ./test ./test/fixtures/partials-relative/base.css', { 'should rewrite path relative to ./test': function(error, stdout) { - assert.equal(stdout, 'a{background:url(/data/partials/extra/down.gif) no-repeat}'); + assert.equal(stdout, 'a{background:url(/fixtures/partials/extra/down.gif) no-repeat}'); } }), - 'no root but output': binaryContext('-o ./base1-min.css ./test/data/partials-relative/base.css', { + 'no root but output': binaryContext('-o ./base1-min.css ./test/fixtures/partials-relative/base.css', { 'should rewrite path relative to current path': function() { var minimized = readFile('./base1-min.css'); - assert.equal(minimized, 'a{background:url(test/data/partials/extra/down.gif) no-repeat}'); + assert.equal(minimized, 'a{background:url(test/fixtures/partials/extra/down.gif) no-repeat}'); }, teardown: function() { deleteFile('./base1-min.css'); } }), - 'root and output': binaryContext('-r ./test/data -o ./base2-min.css ./test/data/partials-relative/base.css', { - 'should rewrite path relative to ./test/data/': function() { + 'root and output': binaryContext('-r ./test/fixtures -o ./base2-min.css ./test/fixtures/partials-relative/base.css', { + 'should rewrite path relative to ./test/fixtures/': function() { var minimized = readFile('./base2-min.css'); assert.equal(minimized, 'a{background:url(/partials/extra/down.gif) no-repeat}'); }, @@ -200,10 +200,10 @@ exports.commandsSuite = vows.describe('binary commands').addBatch({ deleteFile('./base2-min.css'); } }), - 'piped with output': pipedContext('a{background:url(test/data/partials/extra/down.gif)}', '-o base3-min.css', { + 'piped with output': pipedContext('a{background:url(test/fixtures/partials/extra/down.gif)}', '-o base3-min.css', { 'should keep paths as they are': function() { var minimized = readFile('base3-min.css'); - assert.equal(minimized, 'a{background:url(test/data/partials/extra/down.gif)}'); + assert.equal(minimized, 'a{background:url(test/fixtures/partials/extra/down.gif)}'); }, teardown: function() { deleteFile('base3-min.css'); @@ -211,7 +211,7 @@ exports.commandsSuite = vows.describe('binary commands').addBatch({ }) }, 'complex import and url rebasing': { - absolute: binaryContext('-r ./test/data/129-assets ./test/data/129-assets/assets/ui.css', { + absolute: binaryContext('-r ./test/fixtures/129-assets ./test/fixtures/129-assets/assets/ui.css', { 'should rebase urls correctly': function(error, stdout) { assert.isNull(error); assert.include(stdout, 'url(/components/bootstrap/images/glyphs.gif)'); @@ -219,20 +219,20 @@ exports.commandsSuite = vows.describe('binary commands').addBatch({ assert.include(stdout, 'url(/components/jquery-ui/images/next.gif)'); } }), - relative: binaryContext('-o ./test/data/129-assets/assets/ui.bundled.css ./test/data/129-assets/assets/ui.css', { + relative: binaryContext('-o ./test/fixtures/129-assets/assets/ui.bundled.css ./test/fixtures/129-assets/assets/ui.css', { 'should rebase urls correctly': function() { - var minimized = readFile('./test/data/129-assets/assets/ui.bundled.css'); + var minimized = readFile('./test/fixtures/129-assets/assets/ui.bundled.css'); assert.include(minimized, 'url(../components/bootstrap/images/glyphs.gif)'); assert.include(minimized, 'url(../components/jquery-ui/images/prev.gif)'); assert.include(minimized, 'url(../components/jquery-ui/images/next.gif)'); }, teardown: function() { - deleteFile('./test/data/129-assets/assets/ui.bundled.css'); + deleteFile('./test/fixtures/129-assets/assets/ui.bundled.css'); } }) }, 'complex import and skipped url rebasing': { - absolute: binaryContext('-r ./test/data/129-assets --skip-rebase ./test/data/129-assets/assets/ui.css', { + absolute: binaryContext('-r ./test/fixtures/129-assets --skip-rebase ./test/fixtures/129-assets/assets/ui.css', { 'should rebase urls correctly': function(error, stdout) { assert.isNull(error); assert.include(stdout, 'url(../images/glyphs.gif)'); @@ -282,14 +282,14 @@ exports.commandsSuite = vows.describe('binary commands').addBatch({ this.server.close(); } }), - 'ie7 compatibility': binaryContext('--compatibility ie7 ./test/data/unsupported/selectors-ie7.css', { + 'ie7 compatibility': binaryContext('--compatibility ie7 ./test/fixtures/unsupported/selectors-ie7.css', { 'should not transform source': function(error, stdout) { - assert.equal(stdout, readFile('./test/data/unsupported/selectors-ie7.css')); + assert.equal(stdout, readFile('./test/fixtures/unsupported/selectors-ie7.css')); } }), - 'ie8 compatibility': binaryContext('--compatibility ie8 ./test/data/unsupported/selectors-ie8.css', { + 'ie8 compatibility': binaryContext('--compatibility ie8 ./test/fixtures/unsupported/selectors-ie8.css', { 'should not transform source': function(error, stdout) { - assert.equal(stdout, readFile('./test/data/unsupported/selectors-ie8.css')); + assert.equal(stdout, readFile('./test/fixtures/unsupported/selectors-ie8.css')); } }), 'custom compatibility': pipedContext('a{_color:red}', '--compatibility "+properties.iePrefixHack"', { @@ -339,7 +339,7 @@ exports.commandsSuite = vows.describe('binary commands').addBatch({ }) }, 'source maps': { - 'no target file': binaryContext('--source-map ./test/data/reset.css', { + 'no target file': binaryContext('--source-map ./test/fixtures/reset.css', { 'warns about source map not being build': function (error, stdout, stderr) { assert.include(stderr, 'Source maps will not be built because you have not specified an output file.'); }, @@ -347,7 +347,7 @@ exports.commandsSuite = vows.describe('binary commands').addBatch({ assert.notInclude(stdout, '/*# sourceMappingURL'); } }), - 'output file': binaryContext('--source-map -o ./reset.min.css ./test/data/reset.css', { + 'output file': binaryContext('--source-map -o ./reset.min.css ./test/fixtures/reset.css', { 'includes map in minified file': function() { assert.include(readFile('./reset.min.css'), '/*# sourceMappingURL=reset.min.css.map */'); }, @@ -359,7 +359,7 @@ exports.commandsSuite = vows.describe('binary commands').addBatch({ assert.deepEqual( sourceMap.originalPositionFor({ line: 1, column: 1 }), { - source: 'test/data/reset.css', + source: 'test/fixtures/reset.css', line: 4, column: 0, name: null @@ -371,9 +371,9 @@ exports.commandsSuite = vows.describe('binary commands').addBatch({ deleteFile('reset.min.css.map'); } }), - 'output file in same folder as input': binaryContext('--source-map -o ./test/data/reset.min.css ./test/data/reset.css', { + 'output file in same folder as input': binaryContext('--source-map -o ./test/fixtures/reset.min.css ./test/fixtures/reset.css', { 'includes right content in map file': function () { - var sourceMap = new SourceMapConsumer(readFile('./test/data/reset.min.css.map')); + var sourceMap = new SourceMapConsumer(readFile('./test/fixtures/reset.min.css.map')); assert.deepEqual( sourceMap.originalPositionFor({ line: 1, column: 1 }), { @@ -385,17 +385,17 @@ exports.commandsSuite = vows.describe('binary commands').addBatch({ ); }, 'teardown': function () { - deleteFile('test/data/reset.min.css'); - deleteFile('test/data/reset.min.css.map'); + deleteFile('test/fixtures/reset.min.css'); + deleteFile('test/fixtures/reset.min.css.map'); } }), - 'output file with existing map': binaryContext('--source-map -o ./styles.min.css ./test/data/source-maps/styles.css', { + 'output file with existing map': binaryContext('--source-map -o ./styles.min.css ./test/fixtures/source-maps/styles.css', { 'includes right content in map file': function () { var sourceMap = new SourceMapConsumer(readFile('./styles.min.css.map')); assert.deepEqual( sourceMap.originalPositionFor({ line: 1, column: 1 }), { - source: 'test/data/source-maps/styles.less', + source: 'test/fixtures/source-maps/styles.less', line: 1, column: 4, name: null @@ -407,13 +407,13 @@ exports.commandsSuite = vows.describe('binary commands').addBatch({ deleteFile('styles.min.css.map'); } }), - 'output file for existing map in different folder': binaryContext('--source-map -o ./styles-relative.min.css ./test/data/source-maps/relative.css', { + 'output file for existing map in different folder': binaryContext('--source-map -o ./styles-relative.min.css ./test/fixtures/source-maps/relative.css', { 'includes right content in map file': function () { var sourceMap = new SourceMapConsumer(readFile('./styles-relative.min.css.map')); assert.deepEqual( sourceMap.originalPositionFor({ line: 1, column: 1 }), { - source: 'test/data/source-maps/sub/styles.less', + source: 'test/fixtures/source-maps/sub/styles.less', line: 2, column: 2, name: null @@ -425,7 +425,7 @@ exports.commandsSuite = vows.describe('binary commands').addBatch({ deleteFile('styles-relative.min.css.map'); } }), - 'output file with root path': binaryContext('--source-map -o ./reset-root.min.css -r ./test ./test/data/reset.css', { + 'output file with root path': binaryContext('--source-map -o ./reset-root.min.css -r ./test ./test/fixtures/reset.css', { 'includes map in minified file': function() { assert.include(readFile('./reset-root.min.css'), '/*# sourceMappingURL=reset-root.min.css.map */'); }, @@ -437,7 +437,7 @@ exports.commandsSuite = vows.describe('binary commands').addBatch({ assert.deepEqual( sourceMap.originalPositionFor({ line: 1, column: 1 }), { - source: '/data/reset.css', + source: '/fixtures/reset.css', line: 4, column: 0, name: null @@ -449,7 +449,7 @@ exports.commandsSuite = vows.describe('binary commands').addBatch({ deleteFile('reset-root.min.css.map'); } }), - 'with input source map': binaryContext('--source-map -o ./import.min.css ./test/data/source-maps/import.css', { + 'with input source map': binaryContext('--source-map -o ./import.min.css ./test/fixtures/source-maps/import.css', { 'includes map in minified file': function () { assert.include(readFile('./import.min.css'), '/*# sourceMappingURL=import.min.css.map */'); }, diff --git a/test/data-bench/_partial.css b/test/data-bench/_partial.css deleted file mode 100644 index f8ce6803..00000000 --- a/test/data-bench/_partial.css +++ /dev/null @@ -1 +0,0 @@ -@import '../data/blueprint.css'; diff --git a/test/data-bench/complex.css b/test/data-bench/complex.css deleted file mode 100644 index 1e53b24e..00000000 --- a/test/data-bench/complex.css +++ /dev/null @@ -1,4 +0,0 @@ -@import '../data/reset.css'; -@import '_partial.css'; -@import '../data/960.css'; -@import '../data/big.css'; diff --git a/test/data/129-assets/assets/ui.css b/test/fixtures/129-assets/assets/ui.css similarity index 100% rename from test/data/129-assets/assets/ui.css rename to test/fixtures/129-assets/assets/ui.css diff --git a/test/data/129-assets/components/bootstrap/css/bootstrap.css b/test/fixtures/129-assets/components/bootstrap/css/bootstrap.css similarity index 100% rename from test/data/129-assets/components/bootstrap/css/bootstrap.css rename to test/fixtures/129-assets/components/bootstrap/css/bootstrap.css diff --git a/test/data/129-assets/components/bootstrap/images/glyphs.gif b/test/fixtures/129-assets/components/bootstrap/images/glyphs.gif similarity index 100% rename from test/data/129-assets/components/bootstrap/images/glyphs.gif rename to test/fixtures/129-assets/components/bootstrap/images/glyphs.gif diff --git a/test/data/129-assets/components/jquery-ui/css/style.css b/test/fixtures/129-assets/components/jquery-ui/css/style.css similarity index 100% rename from test/data/129-assets/components/jquery-ui/css/style.css rename to test/fixtures/129-assets/components/jquery-ui/css/style.css diff --git a/test/data/129-assets/components/jquery-ui/images/next.gif b/test/fixtures/129-assets/components/jquery-ui/images/next.gif similarity index 100% rename from test/data/129-assets/components/jquery-ui/images/next.gif rename to test/fixtures/129-assets/components/jquery-ui/images/next.gif diff --git a/test/data/129-assets/components/jquery-ui/images/prev.gif b/test/fixtures/129-assets/components/jquery-ui/images/prev.gif similarity index 100% rename from test/data/129-assets/components/jquery-ui/images/prev.gif rename to test/fixtures/129-assets/components/jquery-ui/images/prev.gif diff --git a/test/data/960-min.css b/test/fixtures/960-min.css similarity index 100% rename from test/data/960-min.css rename to test/fixtures/960-min.css diff --git a/test/data/960.css b/test/fixtures/960.css similarity index 100% rename from test/data/960.css rename to test/fixtures/960.css diff --git a/test/fixtures/bench/_partial.css b/test/fixtures/bench/_partial.css new file mode 100644 index 00000000..56fd3c64 --- /dev/null +++ b/test/fixtures/bench/_partial.css @@ -0,0 +1 @@ +@import '../blueprint.css'; diff --git a/test/fixtures/bench/complex.css b/test/fixtures/bench/complex.css new file mode 100644 index 00000000..36aa0b0a --- /dev/null +++ b/test/fixtures/bench/complex.css @@ -0,0 +1,4 @@ +@import '../reset.css'; +@import '_partial.css'; +@import '../960.css'; +@import '../big.css'; diff --git a/test/data/big-min.css b/test/fixtures/big-min.css similarity index 100% rename from test/data/big-min.css rename to test/fixtures/big-min.css diff --git a/test/data/big.css b/test/fixtures/big.css similarity index 100% rename from test/data/big.css rename to test/fixtures/big.css diff --git a/test/data/blueprint-min.css b/test/fixtures/blueprint-min.css similarity index 100% rename from test/data/blueprint-min.css rename to test/fixtures/blueprint-min.css diff --git a/test/data/blueprint.css b/test/fixtures/blueprint.css similarity index 100% rename from test/data/blueprint.css rename to test/fixtures/blueprint.css diff --git a/test/data/charset-mixed-with-fonts-min.css b/test/fixtures/charset-mixed-with-fonts-min.css similarity index 100% rename from test/data/charset-mixed-with-fonts-min.css rename to test/fixtures/charset-mixed-with-fonts-min.css diff --git a/test/data/charset-mixed-with-fonts.css b/test/fixtures/charset-mixed-with-fonts.css similarity index 100% rename from test/data/charset-mixed-with-fonts.css rename to test/fixtures/charset-mixed-with-fonts.css diff --git a/test/data/font-awesome-ie7-min.css b/test/fixtures/font-awesome-ie7-min.css similarity index 100% rename from test/data/font-awesome-ie7-min.css rename to test/fixtures/font-awesome-ie7-min.css diff --git a/test/data/font-awesome-ie7.css b/test/fixtures/font-awesome-ie7.css similarity index 100% rename from test/data/font-awesome-ie7.css rename to test/fixtures/font-awesome-ie7.css diff --git a/test/data/font-awesome-min.css b/test/fixtures/font-awesome-min.css similarity index 100% rename from test/data/font-awesome-min.css rename to test/fixtures/font-awesome-min.css diff --git a/test/data/font-awesome.css b/test/fixtures/font-awesome.css similarity index 100% rename from test/data/font-awesome.css rename to test/fixtures/font-awesome.css diff --git a/test/data/imports-min.css b/test/fixtures/imports-min.css similarity index 100% rename from test/data/imports-min.css rename to test/fixtures/imports-min.css diff --git a/test/data/imports.css b/test/fixtures/imports.css similarity index 100% rename from test/data/imports.css rename to test/fixtures/imports.css diff --git a/test/data/issue-117-snippet-min.css b/test/fixtures/issue-117-snippet-min.css similarity index 100% rename from test/data/issue-117-snippet-min.css rename to test/fixtures/issue-117-snippet-min.css diff --git a/test/data/issue-117-snippet.css b/test/fixtures/issue-117-snippet.css similarity index 100% rename from test/data/issue-117-snippet.css rename to test/fixtures/issue-117-snippet.css diff --git a/test/data/issue-159-snippet-min.css b/test/fixtures/issue-159-snippet-min.css similarity index 100% rename from test/data/issue-159-snippet-min.css rename to test/fixtures/issue-159-snippet-min.css diff --git a/test/data/issue-159-snippet.css b/test/fixtures/issue-159-snippet.css similarity index 100% rename from test/data/issue-159-snippet.css rename to test/fixtures/issue-159-snippet.css diff --git a/test/data/issue-192-min.css b/test/fixtures/issue-192-min.css similarity index 100% rename from test/data/issue-192-min.css rename to test/fixtures/issue-192-min.css diff --git a/test/data/issue-192.css b/test/fixtures/issue-192.css similarity index 100% rename from test/data/issue-192.css rename to test/fixtures/issue-192.css diff --git a/test/data/issue-198-min.css b/test/fixtures/issue-198-min.css similarity index 100% rename from test/data/issue-198-min.css rename to test/fixtures/issue-198-min.css diff --git a/test/data/issue-198.css b/test/fixtures/issue-198.css similarity index 100% rename from test/data/issue-198.css rename to test/fixtures/issue-198.css diff --git a/test/data/issue-232-min.css b/test/fixtures/issue-232-min.css similarity index 100% rename from test/data/issue-232-min.css rename to test/fixtures/issue-232-min.css diff --git a/test/data/issue-232.css b/test/fixtures/issue-232.css similarity index 100% rename from test/data/issue-232.css rename to test/fixtures/issue-232.css diff --git a/test/data/issue-241-min.css b/test/fixtures/issue-241-min.css similarity index 100% rename from test/data/issue-241-min.css rename to test/fixtures/issue-241-min.css diff --git a/test/data/issue-241.css b/test/fixtures/issue-241.css similarity index 100% rename from test/data/issue-241.css rename to test/fixtures/issue-241.css diff --git a/test/data/issue-304-2-min.css b/test/fixtures/issue-304-2-min.css similarity index 100% rename from test/data/issue-304-2-min.css rename to test/fixtures/issue-304-2-min.css diff --git a/test/data/issue-304-2.css b/test/fixtures/issue-304-2.css similarity index 100% rename from test/data/issue-304-2.css rename to test/fixtures/issue-304-2.css diff --git a/test/data/issue-304-min.css b/test/fixtures/issue-304-min.css similarity index 100% rename from test/data/issue-304-min.css rename to test/fixtures/issue-304-min.css diff --git a/test/data/issue-304.css b/test/fixtures/issue-304.css similarity index 100% rename from test/data/issue-304.css rename to test/fixtures/issue-304.css diff --git a/test/data/issue-305-min.css b/test/fixtures/issue-305-min.css similarity index 100% rename from test/data/issue-305-min.css rename to test/fixtures/issue-305-min.css diff --git a/test/data/issue-305.css b/test/fixtures/issue-305.css similarity index 100% rename from test/data/issue-305.css rename to test/fixtures/issue-305.css diff --git a/test/data/issue-308-min.css b/test/fixtures/issue-308-min.css similarity index 100% rename from test/data/issue-308-min.css rename to test/fixtures/issue-308-min.css diff --git a/test/data/issue-308.css b/test/fixtures/issue-308.css similarity index 100% rename from test/data/issue-308.css rename to test/fixtures/issue-308.css diff --git a/test/data/issue-312-min.css b/test/fixtures/issue-312-min.css similarity index 100% rename from test/data/issue-312-min.css rename to test/fixtures/issue-312-min.css diff --git a/test/data/issue-312.css b/test/fixtures/issue-312.css similarity index 100% rename from test/data/issue-312.css rename to test/fixtures/issue-312.css diff --git a/test/data/issue-337-min.css b/test/fixtures/issue-337-min.css similarity index 100% rename from test/data/issue-337-min.css rename to test/fixtures/issue-337-min.css diff --git a/test/data/issue-337.css b/test/fixtures/issue-337.css similarity index 100% rename from test/data/issue-337.css rename to test/fixtures/issue-337.css diff --git a/test/data/issue-395-min.css b/test/fixtures/issue-395-min.css similarity index 100% rename from test/data/issue-395-min.css rename to test/fixtures/issue-395-min.css diff --git a/test/data/issue-395.css b/test/fixtures/issue-395.css similarity index 100% rename from test/data/issue-395.css rename to test/fixtures/issue-395.css diff --git a/test/data/line-breaks-in-attributes-min.css b/test/fixtures/line-breaks-in-attributes-min.css similarity index 100% rename from test/data/line-breaks-in-attributes-min.css rename to test/fixtures/line-breaks-in-attributes-min.css diff --git a/test/data/line-breaks-in-attributes.css b/test/fixtures/line-breaks-in-attributes.css similarity index 100% rename from test/data/line-breaks-in-attributes.css rename to test/fixtures/line-breaks-in-attributes.css diff --git a/test/data/partials-absolute/base.css b/test/fixtures/partials-absolute/base.css similarity index 100% rename from test/data/partials-absolute/base.css rename to test/fixtures/partials-absolute/base.css diff --git a/test/data/partials-absolute/base2.css b/test/fixtures/partials-absolute/base2.css similarity index 100% rename from test/data/partials-absolute/base2.css rename to test/fixtures/partials-absolute/base2.css diff --git a/test/data/partials-absolute/extra/sub.css b/test/fixtures/partials-absolute/extra/sub.css similarity index 100% rename from test/data/partials-absolute/extra/sub.css rename to test/fixtures/partials-absolute/extra/sub.css diff --git a/test/data/partials-relative/base.css b/test/fixtures/partials-relative/base.css similarity index 100% rename from test/data/partials-relative/base.css rename to test/fixtures/partials-relative/base.css diff --git a/test/data/partials-relative/extra/included.css b/test/fixtures/partials-relative/extra/included.css similarity index 100% rename from test/data/partials-relative/extra/included.css rename to test/fixtures/partials-relative/extra/included.css diff --git a/test/data/partials/comment.css b/test/fixtures/partials/comment.css similarity index 100% rename from test/data/partials/comment.css rename to test/fixtures/partials/comment.css diff --git a/test/data/partials/extra/down.gif b/test/fixtures/partials/extra/down.gif similarity index 100% rename from test/data/partials/extra/down.gif rename to test/fixtures/partials/extra/down.gif diff --git a/test/data/partials/extra/four.css b/test/fixtures/partials/extra/four.css similarity index 100% rename from test/data/partials/extra/four.css rename to test/fixtures/partials/extra/four.css diff --git a/test/data/partials/extra/three.css b/test/fixtures/partials/extra/three.css similarity index 100% rename from test/data/partials/extra/three.css rename to test/fixtures/partials/extra/three.css diff --git a/test/data/partials/five.css b/test/fixtures/partials/five.css similarity index 100% rename from test/data/partials/five.css rename to test/fixtures/partials/five.css diff --git a/test/data/partials/four.css b/test/fixtures/partials/four.css similarity index 100% rename from test/data/partials/four.css rename to test/fixtures/partials/four.css diff --git a/test/data/partials/one.css b/test/fixtures/partials/one.css similarity index 100% rename from test/data/partials/one.css rename to test/fixtures/partials/one.css diff --git a/test/data/partials/three.css b/test/fixtures/partials/three.css similarity index 100% rename from test/data/partials/three.css rename to test/fixtures/partials/three.css diff --git a/test/data/partials/two.css b/test/fixtures/partials/two.css similarity index 100% rename from test/data/partials/two.css rename to test/fixtures/partials/two.css diff --git a/test/data/partials/with__double_underscore.css b/test/fixtures/partials/with__double_underscore.css similarity index 100% rename from test/data/partials/with__double_underscore.css rename to test/fixtures/partials/with__double_underscore.css diff --git a/test/data/reset-min.css b/test/fixtures/reset-min.css similarity index 100% rename from test/data/reset-min.css rename to test/fixtures/reset-min.css diff --git a/test/data/reset.css b/test/fixtures/reset.css similarity index 100% rename from test/data/reset.css rename to test/fixtures/reset.css diff --git a/test/data/sample1-min.css b/test/fixtures/sample1-min.css similarity index 100% rename from test/data/sample1-min.css rename to test/fixtures/sample1-min.css diff --git a/test/data/sample1.css b/test/fixtures/sample1.css similarity index 100% rename from test/data/sample1.css rename to test/fixtures/sample1.css diff --git a/test/data/source-maps/import.css b/test/fixtures/source-maps/import.css similarity index 100% rename from test/data/source-maps/import.css rename to test/fixtures/source-maps/import.css diff --git a/test/data/source-maps/nested/once.css b/test/fixtures/source-maps/nested/once.css similarity index 100% rename from test/data/source-maps/nested/once.css rename to test/fixtures/source-maps/nested/once.css diff --git a/test/data/source-maps/nested/once.css.map b/test/fixtures/source-maps/nested/once.css.map similarity index 100% rename from test/data/source-maps/nested/once.css.map rename to test/fixtures/source-maps/nested/once.css.map diff --git a/test/data/source-maps/nested/once.less b/test/fixtures/source-maps/nested/once.less similarity index 100% rename from test/data/source-maps/nested/once.less rename to test/fixtures/source-maps/nested/once.less diff --git a/test/data/source-maps/nested/twice.css b/test/fixtures/source-maps/nested/twice.css similarity index 100% rename from test/data/source-maps/nested/twice.css rename to test/fixtures/source-maps/nested/twice.css diff --git a/test/data/source-maps/nested/twice.css.map b/test/fixtures/source-maps/nested/twice.css.map similarity index 100% rename from test/data/source-maps/nested/twice.css.map rename to test/fixtures/source-maps/nested/twice.css.map diff --git a/test/data/source-maps/nested/twice.less b/test/fixtures/source-maps/nested/twice.less similarity index 100% rename from test/data/source-maps/nested/twice.less rename to test/fixtures/source-maps/nested/twice.less diff --git a/test/data/source-maps/no-map-import.css b/test/fixtures/source-maps/no-map-import.css similarity index 100% rename from test/data/source-maps/no-map-import.css rename to test/fixtures/source-maps/no-map-import.css diff --git a/test/data/source-maps/no-map.css b/test/fixtures/source-maps/no-map.css similarity index 100% rename from test/data/source-maps/no-map.css rename to test/fixtures/source-maps/no-map.css diff --git a/test/data/source-maps/relative.css b/test/fixtures/source-maps/relative.css similarity index 100% rename from test/data/source-maps/relative.css rename to test/fixtures/source-maps/relative.css diff --git a/test/data/source-maps/some.css b/test/fixtures/source-maps/some.css similarity index 100% rename from test/data/source-maps/some.css rename to test/fixtures/source-maps/some.css diff --git a/test/data/source-maps/some.css.map b/test/fixtures/source-maps/some.css.map similarity index 100% rename from test/data/source-maps/some.css.map rename to test/fixtures/source-maps/some.css.map diff --git a/test/data/source-maps/styles.css b/test/fixtures/source-maps/styles.css similarity index 100% rename from test/data/source-maps/styles.css rename to test/fixtures/source-maps/styles.css diff --git a/test/data/source-maps/styles.css.map b/test/fixtures/source-maps/styles.css.map similarity index 100% rename from test/data/source-maps/styles.css.map rename to test/fixtures/source-maps/styles.css.map diff --git a/test/data/source-maps/styles.less b/test/fixtures/source-maps/styles.less similarity index 100% rename from test/data/source-maps/styles.less rename to test/fixtures/source-maps/styles.less diff --git a/test/data/source-maps/sub/styles.css b/test/fixtures/source-maps/sub/styles.css similarity index 100% rename from test/data/source-maps/sub/styles.css rename to test/fixtures/source-maps/sub/styles.css diff --git a/test/data/source-maps/sub/styles.css.map b/test/fixtures/source-maps/sub/styles.css.map similarity index 100% rename from test/data/source-maps/sub/styles.css.map rename to test/fixtures/source-maps/sub/styles.css.map diff --git a/test/data/unsupported/selectors-ie7.css b/test/fixtures/unsupported/selectors-ie7.css similarity index 100% rename from test/data/unsupported/selectors-ie7.css rename to test/fixtures/unsupported/selectors-ie7.css diff --git a/test/data/unsupported/selectors-ie8.css b/test/fixtures/unsupported/selectors-ie8.css similarity index 100% rename from test/data/unsupported/selectors-ie8.css rename to test/fixtures/unsupported/selectors-ie8.css diff --git a/test/integration-test.js b/test/integration-test.js index 94c905a1..1194761a 100644 --- a/test/integration-test.js +++ b/test/integration-test.js @@ -923,18 +923,18 @@ path")}', ] }), 'urls rewriting - no root or target': cssContext({ - 'no @import': 'a{background:url(test/data/partials/extra/down.gif) no-repeat}', + 'no @import': 'a{background:url(test/fixtures/partials/extra/down.gif) no-repeat}', 'relative @import': [ - '@import url(test/data/partials-relative/base.css);', - 'a{background:url(test/data/partials/extra/down.gif) no-repeat}' + '@import url(test/fixtures/partials-relative/base.css);', + 'a{background:url(test/fixtures/partials/extra/down.gif) no-repeat}' ], 'relative @import twice': [ - '@import url(test/data/partials-relative/extra/included.css);', - 'a{background:url(test/data/partials/extra/down.gif) no-repeat}' + '@import url(test/fixtures/partials-relative/extra/included.css);', + 'a{background:url(test/fixtures/partials/extra/down.gif) no-repeat}' ], 'absolute @import': [ - '@import url(/test/data/partials-relative/base.css);', - 'a{background:url(test/data/partials/extra/down.gif) no-repeat}' + '@import url(/test/fixtures/partials-relative/base.css);', + 'a{background:url(test/fixtures/partials/extra/down.gif) no-repeat}' ], 'document-local reference': [ 'svg{marker-end:url(#arrow)}', 'svg{marker-end:url(#arrow)}' @@ -943,75 +943,75 @@ path")}', 'urls rewriting - root but no target': cssContext({ 'no @import': [ 'a{background:url(../partials/extra/down.gif) no-repeat}', - 'a{background:url(/test/data/partials/extra/down.gif) no-repeat}' + 'a{background:url(/test/fixtures/partials/extra/down.gif) no-repeat}' ], 'relative @import': [ '@import url(base.css);', - 'a{background:url(/test/data/partials/extra/down.gif) no-repeat}' + 'a{background:url(/test/fixtures/partials/extra/down.gif) no-repeat}' ], 'absolute @import': [ - '@import url(/test/data/partials-relative/base.css);', - 'a{background:url(/test/data/partials/extra/down.gif) no-repeat}' + '@import url(/test/fixtures/partials-relative/base.css);', + 'a{background:url(/test/fixtures/partials/extra/down.gif) no-repeat}' ], 'document-local reference': [ 'svg{marker-end:url(#arrow)}', 'svg{marker-end:url(#arrow)}' ] }, { root: process.cwd(), - relativeTo: path.join('test', 'data', 'partials-relative') + relativeTo: path.join('test', 'fixtures', 'partials-relative') }), 'urls rewriting - no root but target': cssContext({ 'no @import': [ 'a{background:url(../partials/extra/down.gif) no-repeat}', - 'a{background:url(test/data/partials/extra/down.gif) no-repeat}' + 'a{background:url(test/fixtures/partials/extra/down.gif) no-repeat}' ], 'relative @import': [ '@import url(base.css);', - 'a{background:url(test/data/partials/extra/down.gif) no-repeat}' + 'a{background:url(test/fixtures/partials/extra/down.gif) no-repeat}' ], 'absolute @import': [ - '@import url(/test/data/partials-relative/base.css);', - 'a{background:url(test/data/partials/extra/down.gif) no-repeat}' + '@import url(/test/fixtures/partials-relative/base.css);', + 'a{background:url(test/fixtures/partials/extra/down.gif) no-repeat}' ], 'document-local reference': [ 'svg{marker-end:url(#arrow)}', 'svg{marker-end:url(#arrow)}' ] }, { target: path.join(process.cwd(), 'test.css'), - relativeTo: path.join('test', 'data', 'partials-relative') + relativeTo: path.join('test', 'fixtures', 'partials-relative') }), 'urls rewriting - no root but target as a directory': cssContext({ 'no @import': [ 'a{background:url(../partials/extra/down.gif) no-repeat}', - 'a{background:url(test/data/partials/extra/down.gif) no-repeat}' + 'a{background:url(test/fixtures/partials/extra/down.gif) no-repeat}' ], 'relative @import': [ '@import url(base.css);', - 'a{background:url(test/data/partials/extra/down.gif) no-repeat}' + 'a{background:url(test/fixtures/partials/extra/down.gif) no-repeat}' ], 'absolute @import': [ - '@import url(/test/data/partials-relative/base.css);', - 'a{background:url(test/data/partials/extra/down.gif) no-repeat}' + '@import url(/test/fixtures/partials-relative/base.css);', + 'a{background:url(test/fixtures/partials/extra/down.gif) no-repeat}' ], 'document-local reference': [ 'svg{marker-end:url(#arrow)}', 'svg{marker-end:url(#arrow)}' ] }, { target: process.cwd(), - relativeTo: path.join('test', 'data', 'partials-relative') + relativeTo: path.join('test', 'fixtures', 'partials-relative') }), 'urls rewriting - root and target': cssContext({ 'no @import': [ 'a{background:url(../partials/extra/down.gif) no-repeat}', - 'a{background:url(/test/data/partials/extra/down.gif) no-repeat}' + 'a{background:url(/test/fixtures/partials/extra/down.gif) no-repeat}' ], 'relative @import': [ '@import url(base.css);', - 'a{background:url(/test/data/partials/extra/down.gif) no-repeat}' + 'a{background:url(/test/fixtures/partials/extra/down.gif) no-repeat}' ], 'absolute @import': [ - '@import url(/test/data/partials-relative/base.css);', - 'a{background:url(/test/data/partials/extra/down.gif) no-repeat}' + '@import url(/test/fixtures/partials-relative/base.css);', + 'a{background:url(/test/fixtures/partials/extra/down.gif) no-repeat}' ], 'document-local reference': [ 'svg{marker-end:url(#arrow)}', 'svg{marker-end:url(#arrow)}' @@ -1019,7 +1019,7 @@ path")}', }, { root: process.cwd(), target: path.join(process.cwd(), 'test.css'), - relativeTo: path.join('test', 'data', 'partials-relative') + relativeTo: path.join('test', 'fixtures', 'partials-relative') }), 'urls rewriting - rebase off': cssContext({ 'keeps urls the same': [ @@ -1028,7 +1028,7 @@ path")}', ], }, { target: path.join(process.cwd(), 'test.css'), - relativeTo: path.join('test', 'data', 'partials-relative'), + relativeTo: path.join('test', 'fixtures', 'partials-relative'), rebase: false }), 'fonts': cssContext({ @@ -1285,83 +1285,83 @@ title']{display:block}", '' ], 'of a directory': [ - "@import url(test/data/partials);", + "@import url(test/fixtures/partials);", '' ], 'of a real file': [ - "@import url(test/data/partials/one.css);", + "@import url(test/fixtures/partials/one.css);", ".one{color:red}" ], 'of a real file twice': [ - "@import url(test/data/partials/one.css);@import url(test/data/partials/one.css);", + "@import url(test/fixtures/partials/one.css);@import url(test/fixtures/partials/one.css);", ".one{color:red}" ], 'of a real file with current path prefix': [ - "@import url(./test/data/partials/one.css);", + "@import url(./test/fixtures/partials/one.css);", ".one{color:red}" ], 'of a real file with quoted path': [ - "@import url('test/data/partials/one.css');", + "@import url('test/fixtures/partials/one.css');", ".one{color:red}" ], 'of a real file with double-quoted path': [ - '@import url("test/data/partials/one.css");', + '@import url("test/fixtures/partials/one.css");', ".one{color:red}" ], 'of a real file with bare path': [ - "@import test/data/partials/one.css;", + "@import test/fixtures/partials/one.css;", ".one{color:red}" ], 'of a real file with bare quoted path': [ - "@import 'test/data/partials/one.css';", + "@import 'test/fixtures/partials/one.css';", ".one{color:red}" ], 'of a real file with bare double-quoted path': [ - '@import "test/data/partials/one.css";', + '@import "test/fixtures/partials/one.css";', ".one{color:red}" ], 'of a real file with single simple media': [ - '@import url(test/data/partials/one.css) screen;', + '@import url(test/fixtures/partials/one.css) screen;', "@media screen{.one{color:red}}" ], 'of a real file with multiple simple media': [ - '@import "test/data/partials/one.css" screen, tv, print;', + '@import "test/fixtures/partials/one.css" screen, tv, print;', "@media screen,tv,print{.one{color:red}}" ], 'of a real file with complex media': [ - '@import \'test/data/partials/one.css\' screen and (orientation:landscape);', + '@import \'test/fixtures/partials/one.css\' screen and (orientation:landscape);', "@media screen and (orientation:landscape){.one{color:red}}" ], 'of a real file with a missing trailing semicolon': [ - "@import url(test/data/partials/one.css)", + "@import url(test/fixtures/partials/one.css)", '' ], 'of a real files with a missing trailing semicolon': [ - "@import url(test/data/partials/one.css)@import url(test/data/partials/two.css)", + "@import url(test/fixtures/partials/one.css)@import url(test/fixtures/partials/two.css)", '' ], 'of more files': [ - "@import url(test/data/partials/one.css);\n\n@import url(test/data/partials/extra/three.css);\n\na{display:block}", + "@import url(test/fixtures/partials/one.css);\n\n@import url(test/fixtures/partials/extra/three.css);\n\na{display:block}", ".one{color:red}.three{color:#0f0}a{display:block}" ], 'of more files with media': [ - "@import url(test/data/partials/one.css) screen;@import url(test/data/partials/extra/three.css) tv;", + "@import url(test/fixtures/partials/one.css) screen;@import url(test/fixtures/partials/extra/three.css) tv;", "@media screen{.one{color:red}}@media tv{.three{color:#0f0}}" ], 'of multi-level, circular dependency file': [ - "@import url(test/data/partials/two.css);", + "@import url(test/fixtures/partials/two.css);", ".one{color:red}.three{color:#0f0}.four{color:#00f}.two{color:#fff}" ], 'of a file with a relative resource path': [ - "@import url(test/data/partials/three.css);", - ".three{background-image:url(test/data/partials/extra/down.gif)}" + "@import url(test/fixtures/partials/three.css);", + ".three{background-image:url(test/fixtures/partials/extra/down.gif)}" ], 'of a file with an absolute resource path': [ - "@import url(test/data/partials/four.css);", + "@import url(test/fixtures/partials/four.css);", ".four{background-image:url(/partials/extra/down.gif)}" ], 'of a file with a resource URI': [ - "@import url(test/data/partials/five.css);", + "@import url(test/fixtures/partials/five.css);", ".five{background:url(data:image/jpeg;base64,/9j/)}" ], 'cut off': [ @@ -1373,11 +1373,11 @@ title']{display:block}", '' ], 'inside a comment': [ - '/* @import url(test/data/partials/five.css); */a { color: red; }', + '/* @import url(test/fixtures/partials/five.css); */a { color: red; }', 'a{color:red}' ], 'after a comment': [ - '/* @import url(test/data/partials/one.css); */@import url(test/data/partials/one.css);a { color: red; }', + '/* @import url(test/fixtures/partials/one.css); */@import url(test/fixtures/partials/one.css);a { color: red; }', '.one,a{color:red}' ], 'used arbitrarily in comment': [ @@ -1393,69 +1393,69 @@ title']{display:block}", 'a{color:red}' ], 'of a file with a comment': [ - '@import url(test/data/partials/comment.css);', + '@import url(test/fixtures/partials/comment.css);', 'a{display:block}' ], 'of a file (with media) with a comment': [ - '@import url(test/data/partials/comment.css) screen and (device-height: 600px);', + '@import url(test/fixtures/partials/comment.css) screen and (device-height: 600px);', '@media screen and (device-height:600px){a{display:block}}' ], 'after standard content': [ - "a{display:block}@import url(test/data/partials/one.css);body{margin:0}", + "a{display:block}@import url(test/fixtures/partials/one.css);body{margin:0}", "a{display:block}body{margin:0}" ], 'after quoted content': [ - "/*a{display:block}*/@import url(test/data/partials/one.css);", + "/*a{display:block}*/@import url(test/fixtures/partials/one.css);", ".one{color:red}" ], 'with double underscore': [ - '@import url(test/data/partials/with__double_underscore.css);', + '@import url(test/fixtures/partials/with__double_underscore.css);', '.one{color:green}' ] }, { root: process.cwd() }), 'malformed but still valid @import': cssContext({ 'prefixed with whitespace': [ - " @import 'test/data/partials/one.css';", + " @import 'test/fixtures/partials/one.css';", ".one{color:red}" ], 'no whitespace between @import and filename': [ - "@import'test/data/partials/one.css';", + "@import'test/fixtures/partials/one.css';", ".one{color:red}" ], 'extra whitespace between @import and filename': [ - "@import 'test/data/partials/one.css';", + "@import 'test/fixtures/partials/one.css';", ".one{color:red}" ], 'line break between @import and filename': [ - "@import " + lineBreak + "'test/data/partials/one.css';", + "@import " + lineBreak + "'test/fixtures/partials/one.css';", ".one{color:red}" ], 'extra whitespace prefix in file name': [ - "@import ' test/data/partials/one.css';", + "@import ' test/fixtures/partials/one.css';", ".one{color:red}" ], 'extra whitespace suffix in file name': [ - "@import 'test/data/partials/one.css ';", + "@import 'test/fixtures/partials/one.css ';", ".one{color:red}" ], 'extra whitespace after': [ - "@import 'test/data/partials/one.css' ;", + "@import 'test/fixtures/partials/one.css' ;", ".one{color:red}" ], 'uppercase @import': [ - "@IMPORT 'test/data/partials/one.css';", + "@IMPORT 'test/fixtures/partials/one.css';", ".one{color:red}" ], 'extra whitespace between url and filename': [ - "@import url( test/data/partials/one.css);", + "@import url( test/fixtures/partials/one.css);", ".one{color:red}" ], 'extra whitespace prefix in file name - url': [ - "@import url(' test/data/partials/one.css');", + "@import url(' test/fixtures/partials/one.css');", ".one{color:red}" ], 'extra whitespace suffix in file name - url': [ - "@import url('test/data/partials/one.css ');", + "@import url('test/fixtures/partials/one.css ');", ".one{color:red}" ] }, { root: process.cwd() }), @@ -1484,7 +1484,7 @@ title']{display:block}", "@import url(/partials-absolute/base.css);", ".base2{border-width:0}.sub{padding:0}.base{margin:0}" ] - }, { root: path.join(process.cwd(), 'test', 'data') }), + }, { root: path.join(process.cwd(), 'test', 'fixtures') }), '@import with option processImport': cssContext({ 'of an unknown file': [ "@import url(/fake.css);", diff --git a/test/module-test.js b/test/module-test.js index 8046c8ec..df76624f 100644 --- a/test/module-test.js +++ b/test/module-test.js @@ -80,7 +80,7 @@ vows.describe('module tests').addBatch({ } }, 'warnings': { - 'topic': new CleanCSS({ root: 'test/data', target: 'custom-warnings.css' }).minify('a{color:red}'), + 'topic': new CleanCSS({ root: 'test/fixtures', target: 'custom-warnings.css' }).minify('a{color:red}'), 'are an array': function (error, minified) { assert.isArray(minified.warnings); }, @@ -197,7 +197,7 @@ vows.describe('module tests').addBatch({ }, 'buffer passed in': { 'topic': function() { - return new CleanCSS().minify(new Buffer('@import url(test/data/partials/one.css);')); + return new CleanCSS().minify(new Buffer('@import url(test/fixtures/partials/one.css);')); }, 'should be processed correctly': function(minified) { assert.equal(minified.styles, '.one{color:red}'); @@ -217,15 +217,15 @@ vows.describe('module tests').addBatch({ } }, 'process import': { - 'topic': new CleanCSS({ processImport: true }).minify('@import url(/test/data/partials/one.css);'), + 'topic': new CleanCSS({ processImport: true }).minify('@import url(/test/fixtures/partials/one.css);'), 'gets right output': function (minified) { assert.equal(minified.styles, '.one{color:red}'); } }, 'rebase': { - 'topic': new CleanCSS({ rebase: true, relativeTo: path.join(process.cwd(), 'test', 'data'), root: process.cwd() }).minify('div{background:url(./dummy.png)}'), + 'topic': new CleanCSS({ rebase: true, relativeTo: path.join(process.cwd(), 'test', 'fixtures'), root: process.cwd() }).minify('div{background:url(./dummy.png)}'), 'gets right output': function (minified) { - assert.include(minified.styles, 'url(/test/data/dummy.png)'); + assert.include(minified.styles, 'url(/test/fixtures/dummy.png)'); } } }, @@ -241,27 +241,27 @@ vows.describe('module tests').addBatch({ 'accepts a list of source files as array': { 'rebased to the current dir': { 'relative': { - 'topic': new CleanCSS().minify(['test/data/partials/one.css', 'test/data/partials/three.css']), + 'topic': new CleanCSS().minify(['test/fixtures/partials/one.css', 'test/fixtures/partials/three.css']), 'should give right output': function (minified) { - assert.equal(minified.styles, '.one{color:red}.three{background-image:url(test/data/partials/extra/down.gif)}'); + assert.equal(minified.styles, '.one{color:red}.three{background-image:url(test/fixtures/partials/extra/down.gif)}'); } }, 'absolute': { - 'topic': new CleanCSS({ relativeTo: process.cwd() }).minify([path.resolve('test/data/partials/one.css'), path.resolve('test/data/partials/three.css')]), + 'topic': new CleanCSS({ relativeTo: process.cwd() }).minify([path.resolve('test/fixtures/partials/one.css'), path.resolve('test/fixtures/partials/three.css')]), 'should give right output': function (minified) { - assert.equal(minified.styles, '.one{color:red}.three{background-image:url(test/data/partials/extra/down.gif)}'); + assert.equal(minified.styles, '.one{color:red}.three{background-image:url(test/fixtures/partials/extra/down.gif)}'); } } }, 'rebased to a path': { 'relative': { - 'topic': new CleanCSS({ relativeTo: 'test/data' }).minify(['test/data/partials/one.css', 'test/data/partials/three.css']), + 'topic': new CleanCSS({ relativeTo: 'test/fixtures' }).minify(['test/fixtures/partials/one.css', 'test/fixtures/partials/three.css']), 'should give right output': function (minified) { assert.equal(minified.styles, '.one{color:red}.three{background-image:url(partials/extra/down.gif)}'); } }, 'absolute': { - 'topic': new CleanCSS({ relativeTo: 'test/data' }).minify([path.resolve('test/data/partials/one.css'), path.resolve('test/data/partials/three.css')]), + 'topic': new CleanCSS({ relativeTo: 'test/fixtures' }).minify([path.resolve('test/fixtures/partials/one.css'), path.resolve('test/fixtures/partials/three.css')]), 'should give right output': function (minified) { assert.equal(minified.styles, '.one{color:red}.three{background-image:url(partials/extra/down.gif)}'); } @@ -269,20 +269,20 @@ vows.describe('module tests').addBatch({ }, 'rebased to root': { 'relative': { - 'topic': new CleanCSS({ root: 'test/data', relativeTo: 'test/data' }).minify(['test/data/partials/one.css', 'test/data/partials/three.css']), + 'topic': new CleanCSS({ root: 'test/fixtures', relativeTo: 'test/fixtures' }).minify(['test/fixtures/partials/one.css', 'test/fixtures/partials/three.css']), 'should give right output': function (minified) { assert.equal(minified.styles, '.one{color:red}.three{background-image:url(/partials/extra/down.gif)}'); } }, 'absolute': { - 'topic': new CleanCSS({ root: 'test/data', relativeTo: 'test/data' }).minify([path.resolve('test/data/partials/one.css'), path.resolve('test/data/partials/three.css')]), + 'topic': new CleanCSS({ root: 'test/fixtures', relativeTo: 'test/fixtures' }).minify([path.resolve('test/fixtures/partials/one.css'), path.resolve('test/fixtures/partials/three.css')]), 'should give right output': function (minified) { assert.equal(minified.styles, '.one{color:red}.three{background-image:url(/partials/extra/down.gif)}'); } } }, 'with imports off': { - 'topic': new CleanCSS({ processImport: false }).minify(['./test/data/partials/two.css']), + 'topic': new CleanCSS({ processImport: false }).minify(['./test/fixtures/partials/two.css']), 'should give right output': function (minified) { assert.equal(minified.styles, '@import url(one.css);@import url(extra/three.css);@import url(./extra/four.css);.two{color:#fff}'); } diff --git a/test/protocol-imports-test.js b/test/protocol-imports-test.js index 0bf77ecd..3fcb62e9 100644 --- a/test/protocol-imports-test.js +++ b/test/protocol-imports-test.js @@ -383,7 +383,7 @@ vows.describe('protocol imports').addBatch({ }, 'of a remote resource mixed with local ones': { topic: function() { - var source = '@import url(http://127.0.0.1/remote.css);@import url(test/data/partials/one.css);'; + 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') .reply(200, 'div{padding:0}'); @@ -403,7 +403,7 @@ vows.describe('protocol imports').addBatch({ }, 'of a remote resource mixed with local ones but no callback': { topic: function() { - var source = '@import url(http://127.0.0.1/remote.css);@import url(test/data/partials/one.css);'; + 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') .reply(200, 'div{padding:0}'); diff --git a/test/source-map-test.js b/test/source-map-test.js index 684a747d..f9fa76c9 100644 --- a/test/source-map-test.js +++ b/test/source-map-test.js @@ -6,7 +6,7 @@ var CleanCSS = require('../index'); var fs = require('fs'); var path = require('path'); -var inputMapPath = path.join('test', 'data', 'source-maps', 'styles.css.map'); +var inputMapPath = path.join('test', 'fixtures', 'source-maps', 'styles.css.map'); var inputMap = fs.readFileSync(inputMapPath, 'utf-8'); var nock = require('nock'); @@ -439,31 +439,31 @@ vows.describe('source-map') } }, 'complex input map referenced by path': { - 'topic': new CleanCSS({ sourceMap: true }).minify('@import url(test/data/source-maps/import.css);'), + 'topic': new CleanCSS({ sourceMap: true }).minify('@import url(test/fixtures/source-maps/import.css);'), 'should have 4 mappings': function (minified) { assert.lengthOf(minified.sourceMap._mappings, 4); } }, 'complex but partial input map referenced by path': { - 'topic': new CleanCSS({ sourceMap: true, target: process.cwd() }).minify('@import url(test/data/source-maps/no-map-import.css);'), + 'topic': new CleanCSS({ sourceMap: true, target: process.cwd() }).minify('@import url(test/fixtures/source-maps/no-map-import.css);'), 'should have 4 mappings': function (minified) { assert.lengthOf(minified.sourceMap._mappings, 4); }, 'should have 2 mappings to .less file': function (minified) { var fromLess = minified.sourceMap._mappings.filter(function (mapping) { - return mapping.source == path.join('test', 'data', 'source-maps', 'styles.less'); + return mapping.source == path.join('test', 'fixtures', 'source-maps', 'styles.less'); }); assert.lengthOf(fromLess, 2); }, 'should have 2 mappings to .css file': function (minified) { var fromCSS = minified.sourceMap._mappings.filter(function (mapping) { - return mapping.source == path.join('test', 'data', 'source-maps', 'no-map.css'); + return mapping.source == path.join('test', 'fixtures', 'source-maps', 'no-map.css'); }); assert.lengthOf(fromCSS, 2); } }, 'complex input map with an existing file as target': { - 'topic': new CleanCSS({ sourceMap: true, target: path.join(process.cwd(), 'test', 'data', 'source-maps', 'styles.css') }).minify('@import url(test/data/source-maps/styles.css);'), + 'topic': new CleanCSS({ sourceMap: true, target: path.join(process.cwd(), 'test', 'fixtures', 'source-maps', 'styles.css') }).minify('@import url(test/fixtures/source-maps/styles.css);'), 'should have 2 mappings': function (minified) { assert.lengthOf(minified.sourceMap._mappings, 2); }, @@ -475,7 +475,7 @@ vows.describe('source-map') }, }, 'nested once': { - 'topic': new CleanCSS({ sourceMap: true }).minify('@import url(test/data/source-maps/nested/once.css);'), + 'topic': new CleanCSS({ sourceMap: true }).minify('@import url(test/fixtures/source-maps/nested/once.css);'), 'should have 2 mappings': function (minified) { assert.lengthOf(minified.sourceMap._mappings, 2); }, @@ -503,7 +503,7 @@ vows.describe('source-map') } }, 'nested twice': { - 'topic': new CleanCSS({ sourceMap: true }).minify('@import url(test/data/source-maps/nested/twice.css);'), + 'topic': new CleanCSS({ sourceMap: true }).minify('@import url(test/fixtures/source-maps/nested/twice.css);'), 'should have 2 mappings': function (minified) { assert.lengthOf(minified.sourceMap._mappings, 2); },