Skip to content

Commit

Permalink
fix: allow to pass an {Object} (options.parser) (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
liitfr authored and michael-ciniawsky committed Jun 14, 2017
1 parent adcbb2e commit 4974607
Show file tree
Hide file tree
Showing 6 changed files with 553 additions and 20 deletions.
2 changes: 1 addition & 1 deletion lib/options.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"type": "boolean"
},
"parser": {
"type": "string"
"type": [ "string", "object" ]
},
"syntax": {
"type": "string"
Expand Down
8 changes: 8 additions & 0 deletions test/configs/parser-object.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const sugarss = require('sugarss')

module.exports = {
file: 'parser-object',
options: {
parser: sugarss
}
}
4 changes: 4 additions & 0 deletions test/configs/parser-object.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
test('Parser as an object', () => {
const css = require('../fixtures/style.sss')
expect(css).toEqual('a {\n color: black\n}\n')
})
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
file: 'parser',
file: 'parser-string',
options: {
parser: 'sugarss'
}
Expand Down
2 changes: 1 addition & 1 deletion test/configs/parser.js → test/configs/parser-string.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test('Parser', () => {
test('Parser as a string', () => {
const css = require('../fixtures/style.sss')
expect(css).toEqual('a {\n color: black\n}\n')
})
Loading

0 comments on commit 4974607

Please sign in to comment.