Skip to content

Commit 5c7dca7

Browse files
committed
Allow all errors to be handled by postcss
Doesn't make sense to mix promise rejections with throwing manually
1 parent 18bdada commit 5c7dca7

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

lib/index.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@ var defaults = {
6464
*/
6565

6666
function preprocessor(css, options) {
67-
if (typeof css !== 'string') {
68-
throw new Error('suitcss-preprocessor: did not receive a String');
69-
}
70-
7167
options = mergeOptions(options);
7268

7369
var plugins = options.use.map(function (p) {

test/test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ describe('suitcss', function () {
1919
});
2020
});
2121

22-
it('should throw if css is not a string', function() {
23-
expect(function() {suitcss(null);}).to.throw(Error);
24-
expect(function() {suitcss({});}).to.throw(Error);
22+
it('should handle invalid input', function() {
23+
expect(function() {suitcss(null);}).to.throw(TypeError);
2524
});
2625

2726
describe('using options', function() {

0 commit comments

Comments
 (0)