Skip to content

Commit

Permalink
fix(options): add writeToDisk option to schema (#1520)
Browse files Browse the repository at this point in the history
  • Loading branch information
oNaiPs authored and michael-ciniawsky committed Oct 10, 2018
1 parent bb484ad commit d2f4902
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/options.json
Expand Up @@ -54,6 +54,16 @@
"watchOptions": {
"type": "object"
},
"writeToDisk": {
"anyOf": [
{
"type": "boolean"
},
{
"instanceof": "Function"
}
]
},
"headers": {
"type": "object"
},
Expand Down Expand Up @@ -312,6 +322,7 @@
"port": "should be {String|Number} (https://webpack.js.org/configuration/dev-server/#devserver-port)",
"socket": "should be {String} (https://webpack.js.org/configuration/dev-server/#devserver-socket)",
"watchOptions": "should be {Object} (https://webpack.js.org/configuration/dev-server/#devserver-watchoptions)",
"writeToDisk": "should be {Boolean|Function} (https://github.com/webpack/webpack-dev-middleware#writetodisk)",
"headers": "should be {Object} (https://webpack.js.org/configuration/dev-server/#devserver-headers-)",
"clientLogLevel": "should be {String} and equal to one of the allowed values\n\n [ 'trace', 'debug', 'info', 'warn', 'error', 'silent' ]\n\n(https://webpack.js.org/configuration/dev-server/#devserver-clientloglevel)",
"overlay": "should be {Object|Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-overlay)",
Expand Down
5 changes: 5 additions & 0 deletions test/Validation.test.js
Expand Up @@ -26,6 +26,11 @@ describe('Validation', () => {
config: { logLevel: 1 },
message: 'options.logLevel should be {String} and equal to one of the allowed values'
},
{
name: 'invalid `writeToDisk` configuration',
config: { writeToDisk: 1 },
message: 'options.writeToDisk should be {Boolean|Function} (https://github.com/webpack/webpack-dev-middleware#writetodisk)\n'
},
{
name: 'invalid `overlay` configuration',
config: { overlay: { errors: 1 } },
Expand Down

0 comments on commit d2f4902

Please sign in to comment.