Skip to content

Commit 58e9996

Browse files
authoredOct 14, 2017
fix(schema): allow to pass an {Object} (options.syntax/options.stringifier) (#300)
1 parent 30d8d51 commit 58e9996

8 files changed

+12
-9
lines changed
 

‎lib/options.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
"type": [ "string", "object" ]
2121
},
2222
"syntax": {
23-
"type": "string"
23+
"type": [ "string", "object" ]
2424
},
2525
"stringifier": {
26-
"type": "string"
26+
"type": [ "string", "object" ]
2727
},
2828
"sourceMap": {
2929
"type": [ "string", "boolean" ]

‎test/loader.test.js

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ const { loader } = require('./helpers/compilation')
55

66
describe('Loader', () => {
77
test('Default', () => {
8-
const _ = /style\.(exec\.js|js)$/
98
const config = {
109
loader: {
1110
options: {
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

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

55
exports[`Options Parser - {String} 1`] = `"module.exports = \\"a {\\\\n color: black\\\\n}\\\\n\\""`;
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3+
exports[`Options Stringifier - {Object} 1`] = `"module.exports = \\"a color: black\\\\n\\""`;
4+
35
exports[`Options Stringifier - {String} 1`] = `"module.exports = \\"a color: black\\\\n\\""`;
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

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

‎test/options/parser.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe('Options', () => {
2121
})
2222
})
2323

24-
test('Parser - {Function}', () => {
24+
test('Parser - {Object}', () => {
2525
const config = {
2626
loader: {
2727
options: {

‎test/options/stringifier.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ describe('Options', () => {
2020
expect(src).toMatchSnapshot()
2121
})
2222
})
23-
// TODO fix schema
24-
test.skip('Stringifier - {Function}', () => {
23+
24+
test('Stringifier - {Object}', () => {
2525
const config = {
2626
loader: {
2727
options: {

‎test/options/syntax.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ describe('Options', () => {
2020
expect(src).toMatchSnapshot()
2121
})
2222
})
23-
// TODO fix schema
24-
test.skip('Syntax - {Function}', () => {
23+
24+
test('Syntax - {Object}', () => {
2525
const config = {
2626
loader: {
2727
options: {

0 commit comments

Comments
 (0)
Please sign in to comment.