Skip to content

Commit

Permalink
fix: allow to pass an {Object} (options.syntax/options.stringifier)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-ciniawsky committed Oct 14, 2017
1 parent 30d8d51 commit 1c58e12
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 9 deletions.
4 changes: 2 additions & 2 deletions lib/options.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
"type": [ "string", "object" ]
},
"syntax": {
"type": "string"
"type": [ "string", "object" ]
},
"stringifier": {
"type": "string"
"type": [ "string", "object" ]
},
"sourceMap": {
"type": [ "string", "boolean" ]
Expand Down
1 change: 0 additions & 1 deletion test/loader.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const { loader } = require('./helpers/compilation')

describe('Loader', () => {
test('Default', () => {
const _ = /style\.(exec\.js|js)$/
const config = {
loader: {
options: {
Expand Down
2 changes: 1 addition & 1 deletion test/options/__snapshots__/parser.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Options Parser - {Function} 1`] = `"module.exports = \\"a {\\\\n color: black\\\\n}\\\\n\\""`;
exports[`Options Parser - {Object} 1`] = `"module.exports = \\"a {\\\\n color: black\\\\n}\\\\n\\""`;

exports[`Options Parser - {String} 1`] = `"module.exports = \\"a {\\\\n color: black\\\\n}\\\\n\\""`;
2 changes: 2 additions & 0 deletions test/options/__snapshots__/stringifier.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Options Stringifier - {Object} 1`] = `"module.exports = \\"a color: black\\\\n\\""`;

exports[`Options Stringifier - {String} 1`] = `"module.exports = \\"a color: black\\\\n\\""`;
2 changes: 2 additions & 0 deletions test/options/__snapshots__/syntax.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Options Syntax - {Object} 1`] = `"module.exports = \\"a\\\\n color: black\\\\n\\""`;

exports[`Options Syntax - {String} 1`] = `"module.exports = \\"a\\\\n color: black\\\\n\\""`;
2 changes: 1 addition & 1 deletion test/options/parser.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('Options', () => {
})
})

test('Parser - {Function}', () => {
test('Parser - {Object}', () => {
const config = {
loader: {
options: {
Expand Down
4 changes: 2 additions & 2 deletions test/options/stringifier.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ describe('Options', () => {
expect(src).toMatchSnapshot()
})
})
// TODO fix schema
test.skip('Stringifier - {Function}', () => {

test('Stringifier - {Object}', () => {
const config = {
loader: {
options: {
Expand Down
4 changes: 2 additions & 2 deletions test/options/syntax.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ describe('Options', () => {
expect(src).toMatchSnapshot()
})
})
// TODO fix schema
test.skip('Syntax - {Function}', () => {

test('Syntax - {Object}', () => {
const config = {
loader: {
options: {
Expand Down

0 comments on commit 1c58e12

Please sign in to comment.