Skip to content

Commit

Permalink
add test for exception when class name used in several scopes
Browse files Browse the repository at this point in the history
  • Loading branch information
lahmatiy committed Mar 21, 2016
1 parent f436c0c commit dff938b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/usage.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,18 @@ describe('compress with usage', function() {
});
});

it('should throw exception when class name specified in several scopes', function() {
assert.throws(function() {
csso.minify('.foo { p: 1 }', {
usage: {
scopes: [['foo'], ['foo']]
}
});
}, function(e) {
return e.message === 'Class can\'t be used for several scopes: foo';
});
});

it('should throw exception when selector has classes from different scopes', function() {
assert.throws(function() {
csso.minify('.a.b { p: 1 }', {
Expand Down

0 comments on commit dff938b

Please sign in to comment.