Skip to content

Commit

Permalink
fix: update schema for index and methods properties (#1397)
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Nov 27, 2022
1 parent b3950e5 commit cda328e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/options.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"type": "array",
"items": {
"type": "string",
"minlength": "1"
"minLength": 1
}
},
"headers": {
Expand Down Expand Up @@ -116,7 +116,7 @@
},
{
"type": "string",
"minlength": "1"
"minLength": 1
}
]
}
Expand Down
12 changes: 6 additions & 6 deletions test/__snapshots__/validation-options.test.js.snap.webpack5
Original file line number Diff line number Diff line change
Expand Up @@ -42,37 +42,37 @@ exports[`validation should throw an error on the "headers" option with "true" va
exports[`validation should throw an error on the "index" option with "{}" value 1`] = `
"Invalid options object. Dev Middleware has been initialized using an options object that does not match the API schema.
- options.index should be one of these:
boolean | string
boolean | non-empty string
-> Allows to serve an index of the directory.
-> Read more at https://github.com/webpack/webpack-dev-middleware#index
Details:
* options.index should be a boolean.
* options.index should be a string."
* options.index should be a non-empty string."
`;

exports[`validation should throw an error on the "index" option with "0" value 1`] = `
"Invalid options object. Dev Middleware has been initialized using an options object that does not match the API schema.
- options.index should be one of these:
boolean | string
boolean | non-empty string
-> Allows to serve an index of the directory.
-> Read more at https://github.com/webpack/webpack-dev-middleware#index
Details:
* options.index should be a boolean.
* options.index should be a string."
* options.index should be a non-empty string."
`;

exports[`validation should throw an error on the "methods" option with "{}" value 1`] = `
"Invalid options object. Dev Middleware has been initialized using an options object that does not match the API schema.
- options.methods should be an array:
[string, ...]
[non-empty string, ...]
-> Allows to pass the list of HTTP request methods accepted by the middleware.
-> Read more at https://github.com/webpack/webpack-dev-middleware#methods"
`;

exports[`validation should throw an error on the "methods" option with "true" value 1`] = `
"Invalid options object. Dev Middleware has been initialized using an options object that does not match the API schema.
- options.methods should be an array:
[string, ...]
[non-empty string, ...]
-> Allows to pass the list of HTTP request methods accepted by the middleware.
-> Read more at https://github.com/webpack/webpack-dev-middleware#methods"
`;
Expand Down

0 comments on commit cda328e

Please sign in to comment.