Skip to content

Commit

Permalink
fix: correct schema for ClientLogging (#4084)
Browse files Browse the repository at this point in the history
* fix: correct schema for `ClientLogging`

* fix: ci
  • Loading branch information
snitin315 authored Dec 8, 2021
1 parent 79a169b commit 9b7ae7b
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
6 changes: 2 additions & 4 deletions bin/cli-flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,11 @@ module.exports = {
type: "enum",
values: ["none", "error", "warn", "info", "log", "verbose"],
multiple: false,
description:
"Allows to specify options for client script in the browser or disable client script.",
description: "Allows to set log level in the browser.",
path: "client.logging",
},
],
description:
"Allows to specify options for client script in the browser or disable client script.",
description: "Allows to set log level in the browser.",
simpleType: "string",
multiple: false,
},
Expand Down
2 changes: 1 addition & 1 deletion lib/options.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
},
"ClientLogging": {
"enum": ["none", "error", "warn", "info", "log", "verbose"],
"decription": "Allows to set log level in the browser.",
"description": "Allows to set log level in the browser.",
"link": "https://webpack.js.org/configuration/dev-server/#logging"
},
"ClientOverlay": {
Expand Down
2 changes: 2 additions & 0 deletions test/__snapshots__/validate-options.test.js.snap.webpack4
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,15 @@ exports[`options validate should throw an error on the "client" option with '{"l
"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
- options.client.logging should be one of these:
\\"none\\" | \\"error\\" | \\"warn\\" | \\"info\\" | \\"log\\" | \\"verbose\\"
-> Allows to set log level in the browser.
-> Read more at https://webpack.js.org/configuration/dev-server/#logging"
`;

exports[`options validate should throw an error on the "client" option with '{"logging":"whoops!"}' value 1`] = `
"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
- options.client.logging should be one of these:
\\"none\\" | \\"error\\" | \\"warn\\" | \\"info\\" | \\"log\\" | \\"verbose\\"
-> Allows to set log level in the browser.
-> Read more at https://webpack.js.org/configuration/dev-server/#logging"
`;

Expand Down
2 changes: 2 additions & 0 deletions test/__snapshots__/validate-options.test.js.snap.webpack5
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,15 @@ exports[`options validate should throw an error on the "client" option with '{"l
"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
- options.client.logging should be one of these:
\\"none\\" | \\"error\\" | \\"warn\\" | \\"info\\" | \\"log\\" | \\"verbose\\"
-> Allows to set log level in the browser.
-> Read more at https://webpack.js.org/configuration/dev-server/#logging"
`;

exports[`options validate should throw an error on the "client" option with '{"logging":"whoops!"}' value 1`] = `
"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
- options.client.logging should be one of these:
\\"none\\" | \\"error\\" | \\"warn\\" | \\"info\\" | \\"log\\" | \\"verbose\\"
-> Allows to set log level in the browser.
-> Read more at https://webpack.js.org/configuration/dev-server/#logging"
`;

Expand Down
2 changes: 1 addition & 1 deletion test/cli/__snapshots__/basic.test.js.snap.webpack4
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Options:
--no-bonjour Disallows to broadcasts dev server via ZeroConf networking on start.
--client-web-socket-transport <value> Allows to set custom web socket transport to communicate with dev server.
--no-client Negative 'client' option.
--client-logging <value> Allows to specify options for client script in the browser or disable client script.
--client-logging <value> Allows to set log level in the browser.
--client-progress Prints compilation progress in percentage in the browser.
--no-client-progress Does not print compilation progress in percentage in the browser.
--client-overlay Enables a full-screen overlay in the browser when there are compiler errors or warnings.
Expand Down
2 changes: 1 addition & 1 deletion test/cli/__snapshots__/basic.test.js.snap.webpack5
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Options:
--bonjour Allows to broadcasts dev server via ZeroConf networking on start.
--no-bonjour Negative 'bonjour' option.
--no-client Negative 'client' option.
--client-logging <value> Allows to specify options for client script in the browser or disable client script.
--client-logging <value> Allows to set log level in the browser.
--client-overlay Enables a full-screen overlay in the browser when there are compiler errors or warnings.
--no-client-overlay Negative 'client-overlay' option.
--client-overlay-errors Enables a full-screen overlay in the browser when there are compiler errors.
Expand Down

0 comments on commit 9b7ae7b

Please sign in to comment.