Skip to content

Commit

Permalink
Merge pull request csscomb#147 from csscomb/tg/test-helpers
Browse files Browse the repository at this point in the history
Tests: Add helpers
  • Loading branch information
mishanga committed Jan 8, 2014
2 parents 3296c2d + d32b807 commit cab8285
Show file tree
Hide file tree
Showing 208 changed files with 1,132 additions and 1,734 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"csscomb": "./bin/csscomb"
},
"scripts": {
"test": "./node_modules/.bin/jshint-groups && ./node_modules/.bin/jscs . && ./node_modules/.bin/mocha -u bdd -R dot",
"test-cov": "rm -rf lib-cov && jscoverage lib lib-cov && TEST_COV=true ./node_modules/.bin/mocha -R html-cov > ./test/test-coverage.html"
"test": "./node_modules/.bin/jshint-groups && ./node_modules/.bin/jscs . && node test/mocha",
"test-cov": "rm -rf lib-cov && jscoverage lib lib-cov && TEST_COV=true node test/mocha > ./test/test-coverage.html"
}
}
100 changes: 0 additions & 100 deletions test/always-semicolon-less.js

This file was deleted.

108 changes: 0 additions & 108 deletions test/always-semicolon-scss.js

This file was deleted.

2 changes: 1 addition & 1 deletion test/configure.js → test/core/configure.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Comb = process.env.TEST_COV ? require('../lib-cov/csscomb') : require('../lib/csscomb');
var Comb = process.env.TEST_COV ? require('../../lib-cov/csscomb') : require('../../lib/csscomb');
var assert = require('assert');

describe('csscomb methods', function() {
Expand Down
51 changes: 51 additions & 0 deletions test/core/get-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
var assert = require('assert');

describe('csscomb methods', function() {
it('getConfig()', function() {
var config = require('../../config/csscomb.json');

assert.equal(this.comb.getConfig(), config);
});

it('getConfig(number)', function() {
assert.throws(function() {
this.comb.getConfig(16);
});
});

it('getConfig(boolean)', function() {
assert.throws(function() {
this.comb.getConfig(true);
});
});

it('getConfig(empty string)', function() {
var config = require('../../config/csscomb.json');

assert.equal(this.comb.getConfig(''), config);
});

it('getConfig(invalid string)', function() {
assert.throws(function() {
this.comb.getConfig('nani');
});
});

it('getConfig(csscomb)', function() {
var config = require('../../config/csscomb.json');

assert.equal(this.comb.getConfig('csscomb'), config);
});

it('getConfig(zen)', function() {
var config = require('../../config/zen.json');

assert.equal(this.comb.getConfig('zen'), config);
});

it('getConfig(yandex)', function() {
var config = require('../../config/yandex.json');

assert.equal(this.comb.getConfig('yandex'), config);
});
});
42 changes: 42 additions & 0 deletions test/core/less.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
describe('LESS', function() {
beforeEach(function() {
this.filename = __filename;
this.comb.configure({});
});

it('Should parse nested rules', function() {
this.shouldBeEqual('nested-rule.less');
});

it('Should parse operations', function() {
this.shouldBeEqual('operation.less');
});

it('Should parse parent selector &', function() {
this.shouldBeEqual('parent-selector.less');
});

it('Should parse variables', function() {
this.shouldBeEqual('variable.less');
});

it('Should parse interpolated variables inside selectors', function() {
this.shouldBeEqual('interpolated-variable-1.less');
});

it('Should parse interpolated variables inside values', function() {
this.shouldBeEqual('interpolated-variable-2.less');
});

it('Should parse @import', function() {
this.shouldBeEqual('import.less');
});

it('Should parse included mixins', function() {
this.shouldBeEqual('mixin.less');
});

it('Should parse nested @media', function() {
this.shouldBeEqual('nested-media.less');
});
});
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit cab8285

Please sign in to comment.