Skip to content

Commit 58e9996

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

File tree

8 files changed

+12
-9
lines changed

8 files changed

+12
-9
lines changed

lib/options.json

Lines changed: 2 additions & 2 deletions
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

Lines changed: 0 additions & 1 deletion
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: {
Lines changed: 1 addition & 1 deletion
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\\""`;
Lines changed: 2 additions & 0 deletions
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\\""`;
Lines changed: 2 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy