Skip to content

Commit b5753ad

Browse files
committed
Tests update
1 parent 540da80 commit b5753ad

File tree

3 files changed

+62
-46
lines changed

3 files changed

+62
-46
lines changed

test/colon-space.js

Lines changed: 42 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,60 +9,72 @@ describe('options/colon-space', function() {
99
it('Invalid String should not change space around colon', function() {
1010
comb.configure({ 'colon-space': 'foobar' });
1111
assert.equal(
12-
comb.processString('a { color: red }'),
13-
'a { color: red }'
12+
comb.processString('a { color : red }'),
13+
'a { color : red }'
1414
);
1515
});
1616
it('True Boolean value should set space after colon', function() {
1717
comb.configure({ 'colon-space': true });
1818
assert.equal(
1919
comb.processString(
20-
'a { color: red }\n' +
21-
'b{color:blue}\n' +
22-
'i {font : 0/0 a}'
20+
'a { color: red }' +
21+
'a{color:red}' +
22+
'a {color : red}' +
23+
'a {color : /* foo */ red }' +
24+
'a {color /* bar */ : red }'
2325
),
24-
'a { color: red }\n' +
25-
'b{color: blue}\n' +
26-
'i {font: 0/0 a}'
26+
'a { color: red }' +
27+
'a{color: red}' +
28+
'a {color: red}' +
29+
'a {color: /* foo */ red }' +
30+
'a {color /* bar */: red }'
2731
);
2832
});
29-
it('`before` value should set space before colon', function() {
30-
comb.configure({ 'colon-space': 'before' });
33+
it('`after` value should set space after colon', function() {
34+
comb.configure({ 'colon-space': 'after' });
3135
assert.equal(
3236
comb.processString(
33-
'a { color: red }\n' +
34-
'b{color:blue}\n' +
35-
'i {font : 0/0 a}'
37+
'a { color: red }' +
38+
'a{color:red}' +
39+
'a {color : red}' +
40+
'a {color : /* foo */ red }' +
41+
'a {color /* bar */ : red }'
3642
),
37-
'a { color :red }\n' +
38-
'b{color :blue}\n' +
39-
'i {font :0/0 a}'
43+
'a { color: red }' +
44+
'a{color: red}' +
45+
'a {color: red}' +
46+
'a {color: /* foo */ red }' +
47+
'a {color /* bar */: red }'
4048
);
4149
});
42-
it('`after` value should set space before colon', function() {
43-
comb.configure({ 'colon-space': 'after' });
50+
it('`before` value should set space before colon', function() {
51+
comb.configure({ 'colon-space': 'before' });
4452
assert.equal(
4553
comb.processString(
46-
'a { color: red }\n' +
47-
'b{color:blue}\n' +
48-
'i {font : 0/0 a}'
54+
'a { color: red }' +
55+
'a{color:red}' +
56+
'a {color : red}' +
57+
'a {color : /* foo */ red }' +
58+
'a {color /* bar */ : red }'
4959
),
50-
'a { color: red }\n' +
51-
'b{color: blue}\n' +
52-
'i {font: 0/0 a}'
60+
'a { color :red }' +
61+
'a{color :red}' +
62+
'a {color :red}' +
63+
'a {color :/* foo */ red }' +
64+
'a {color /* bar */ :red }'
5365
);
5466
});
5567
it('`both` value should set spaces around colon', function() {
5668
comb.configure({ 'colon-space': 'both' });
5769
assert.equal(
5870
comb.processString(
59-
'a { color: red }\n' +
60-
'b{color:blue}\n' +
61-
'i {font : 0/0 a}'
71+
'a { color: red }' +
72+
'a{color:red}' +
73+
'a {color : red}'
6274
),
63-
'a { color : red }\n' +
64-
'b{color : blue}\n' +
65-
'i {font : 0/0 a}'
75+
'a { color : red }' +
76+
'a{color : red}' +
77+
'a {color : red}'
6678
);
6779
});
6880
});

test/stick-brace.js

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,30 @@ describe('options/stick-brace', function() {
1717
comb.configure({ 'stick-brace': true });
1818
assert.equal(
1919
comb.processString(
20-
'a { color: red }\n' +
21-
'b{color:blue}\n' +
22-
'i \t\t \n{font:0/0 a}'
20+
'a { color: red }' +
21+
'a{color:red}' +
22+
'a \t\t \n{color:red}' +
23+
'a /* foo */ {color:red}'
2324
),
24-
'a { color: red }\n' +
25-
'b {color:blue}\n' +
26-
'i {font:0/0 a}'
25+
'a { color: red }' +
26+
'a {color:red}' +
27+
'a {color:red}' +
28+
'a /* foo */ {color:red}'
2729
);
2830
});
2931
it('Valid String value should set equal space after brace', function() {
3032
comb.configure({ 'stick-brace': '\n' });
3133
assert.equal(
3234
comb.processString(
33-
'a { color: red }\n' +
34-
'b{color:blue}\n' +
35-
'i \t\t \n{font:0/0 a}'
35+
'a { color: red }' +
36+
'a{color:red}' +
37+
'a \t\t \n{color:red}' +
38+
'a /* foo */ {color:red}'
3639
),
37-
'a\n{ color: red }\n' +
38-
'b\n{color:blue}\n' +
39-
'i\n{font:0/0 a}'
40+
'a\n{ color: red }' +
41+
'a\n{color:red}' +
42+
'a\n{color:red}' +
43+
'a /* foo */\n{color:red}'
4044
);
4145
});
4246
});

test/strip-space.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ describe('options/strip-space', function() {
1818
assert.equal(
1919
comb.processString(
2020
'a { color: red } \n' +
21-
'b{color:blue}\t \n' +
22-
'i {font:0/0 a}'
21+
'a{color:red}\t /* foobar */ \n' +
22+
'a {color:red}'
2323
),
2424
'a { color: red }\n' +
25-
'b{color:blue}\n' +
26-
'i {font:0/0 a}\n'
25+
'a{color:red}\t /* foobar */\n' +
26+
'a {color:red}\n'
2727
);
2828
});
2929
});

0 commit comments

Comments
 (0)