-
Notifications
You must be signed in to change notification settings - Fork 458
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
101 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "csscomb", | ||
"description": "CSS coding style formatter", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"homepage": "http://csscomb.com/", | ||
"author": "Mikhail Troshev <[email protected]>", | ||
"repository": "https://github.com/csscomb/csscomb.js", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
var Comb = require('../lib/csscomb'); | ||
var assert = require('assert'); | ||
var fs = require('fs'); | ||
|
||
describe('options/remove-empty-rulesets (scss)', function() { | ||
var comb = new Comb({ 'remove-empty-rulesets': true }); | ||
var input; | ||
var expected; | ||
|
||
function readFile(path) { | ||
return fs.readFileSync('test/remove-empty-rulesets-scss/' + path, 'utf8'); | ||
} | ||
|
||
it('Should not remove rulesets which contain only includes', function() { | ||
input = readFile('include.scss', 'utf-8'); | ||
assert.equal(comb.processString(input, 'scss'), input); | ||
}); | ||
|
||
it('Should remove rulesets with contain only empty nested rules', function() { | ||
input = readFile('empty-nested-rule.scss', 'utf-8'); | ||
expected = readFile('empty-nested-rule.expected.scss', 'utf-8'); | ||
assert.equal(comb.processString(input, 'scss'), expected); | ||
}); | ||
|
||
it('Should not remove rulesets with non-empty nested rules. Test 1', function() { | ||
input = readFile('nested-rule-1.scss', 'utf-8'); | ||
assert.equal(comb.processString(input, 'scss'), input); | ||
}); | ||
|
||
it('Should not remove rulesets with non-empty nested rules. Test 2', function() { | ||
input = readFile('nested-rule-2.scss', 'utf-8'); | ||
expected = readFile('nested-rule-2.expected.scss', 'utf-8'); | ||
assert.equal(comb.processString(input, 'scss'), expected); | ||
}); | ||
}); |
1 change: 1 addition & 0 deletions
1
test/remove-empty-rulesets-scss/empty-nested-rule.expected.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.parent { | ||
.child { | ||
.grandchild { } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.parent { | ||
@include mix-all; | ||
@include mix-top; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.parent { | ||
.child { | ||
@include mix-all; | ||
@include mix-top; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.parent { | ||
.child1 { | ||
@include mix-all; | ||
@include mix-top; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.parent { | ||
.child1 { | ||
@include mix-all; | ||
@include mix-top; | ||
} | ||
.child2 { | ||
.grandchild { } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters