Skip to content

Commit cab8285

Browse files
committed
Merge pull request #147 from csscomb/tg/test-helpers
Tests: Add helpers
2 parents 3296c2d + d32b807 commit cab8285

File tree

208 files changed

+1132
-1734
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

208 files changed

+1132
-1734
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"csscomb": "./bin/csscomb"
6262
},
6363
"scripts": {
64-
"test": "./node_modules/.bin/jshint-groups && ./node_modules/.bin/jscs . && ./node_modules/.bin/mocha -u bdd -R dot",
65-
"test-cov": "rm -rf lib-cov && jscoverage lib lib-cov && TEST_COV=true ./node_modules/.bin/mocha -R html-cov > ./test/test-coverage.html"
64+
"test": "./node_modules/.bin/jshint-groups && ./node_modules/.bin/jscs . && node test/mocha",
65+
"test-cov": "rm -rf lib-cov && jscoverage lib lib-cov && TEST_COV=true node test/mocha > ./test/test-coverage.html"
6666
}
6767
}

test/always-semicolon-less.js

Lines changed: 0 additions & 100 deletions
This file was deleted.

test/always-semicolon-scss.js

Lines changed: 0 additions & 108 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var Comb = process.env.TEST_COV ? require('../lib-cov/csscomb') : require('../lib/csscomb');
1+
var Comb = process.env.TEST_COV ? require('../../lib-cov/csscomb') : require('../../lib/csscomb');
22
var assert = require('assert');
33

44
describe('csscomb methods', function() {

test/core/get-config.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
var assert = require('assert');
2+
3+
describe('csscomb methods', function() {
4+
it('getConfig()', function() {
5+
var config = require('../../config/csscomb.json');
6+
7+
assert.equal(this.comb.getConfig(), config);
8+
});
9+
10+
it('getConfig(number)', function() {
11+
assert.throws(function() {
12+
this.comb.getConfig(16);
13+
});
14+
});
15+
16+
it('getConfig(boolean)', function() {
17+
assert.throws(function() {
18+
this.comb.getConfig(true);
19+
});
20+
});
21+
22+
it('getConfig(empty string)', function() {
23+
var config = require('../../config/csscomb.json');
24+
25+
assert.equal(this.comb.getConfig(''), config);
26+
});
27+
28+
it('getConfig(invalid string)', function() {
29+
assert.throws(function() {
30+
this.comb.getConfig('nani');
31+
});
32+
});
33+
34+
it('getConfig(csscomb)', function() {
35+
var config = require('../../config/csscomb.json');
36+
37+
assert.equal(this.comb.getConfig('csscomb'), config);
38+
});
39+
40+
it('getConfig(zen)', function() {
41+
var config = require('../../config/zen.json');
42+
43+
assert.equal(this.comb.getConfig('zen'), config);
44+
});
45+
46+
it('getConfig(yandex)', function() {
47+
var config = require('../../config/yandex.json');
48+
49+
assert.equal(this.comb.getConfig('yandex'), config);
50+
});
51+
});

test/core/less.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
describe('LESS', function() {
2+
beforeEach(function() {
3+
this.filename = __filename;
4+
this.comb.configure({});
5+
});
6+
7+
it('Should parse nested rules', function() {
8+
this.shouldBeEqual('nested-rule.less');
9+
});
10+
11+
it('Should parse operations', function() {
12+
this.shouldBeEqual('operation.less');
13+
});
14+
15+
it('Should parse parent selector &', function() {
16+
this.shouldBeEqual('parent-selector.less');
17+
});
18+
19+
it('Should parse variables', function() {
20+
this.shouldBeEqual('variable.less');
21+
});
22+
23+
it('Should parse interpolated variables inside selectors', function() {
24+
this.shouldBeEqual('interpolated-variable-1.less');
25+
});
26+
27+
it('Should parse interpolated variables inside values', function() {
28+
this.shouldBeEqual('interpolated-variable-2.less');
29+
});
30+
31+
it('Should parse @import', function() {
32+
this.shouldBeEqual('import.less');
33+
});
34+
35+
it('Should parse included mixins', function() {
36+
this.shouldBeEqual('mixin.less');
37+
});
38+
39+
it('Should parse nested @media', function() {
40+
this.shouldBeEqual('nested-media.less');
41+
});
42+
});
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)