Skip to content

Commit 670966f

Browse files
authored
fix: description of client.path and client.port (#3295)
1 parent 3e031ee commit 670966f

File tree

4 files changed

+42
-2
lines changed

4 files changed

+42
-2
lines changed

lib/options.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@
163163
},
164164
"path": {
165165
"type": "string",
166-
"description": "Tells clients connected to devServer to use the provided port."
166+
"description": "Tells clients connected to devServer to use the provided path to connect."
167167
},
168168
"port": {
169169
"anyOf": [
@@ -177,7 +177,7 @@
177177
"type": "null"
178178
}
179179
],
180-
"description": "Tells clients connected to devServer to use the provided path to connect."
180+
"description": "Tells clients connected to devServer to use the provided port."
181181
},
182182
"logging": {
183183
"enum": ["none", "error", "warn", "info", "log", "verbose"],

test/__snapshots__/validate-options.test.js.snap.webpack4

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,23 @@ exports[`options validate should throw an error on the "client" option with '{"o
7373
-> Show a full-screen overlay in the browser when there are compiler warnings."
7474
`;
7575

76+
exports[`options validate should throw an error on the "client" option with '{"path":true}' value 1`] = `
77+
"ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
78+
- configuration.client.path should be a string.
79+
-> Tells clients connected to devServer to use the provided path to connect."
80+
`;
81+
82+
exports[`options validate should throw an error on the "client" option with '{"port":true}' value 1`] = `
83+
"ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
84+
- configuration.client.port should be one of these:
85+
number | string | null
86+
-> Tells clients connected to devServer to use the provided port.
87+
Details:
88+
* configuration.client.port should be a number.
89+
* configuration.client.port should be a string.
90+
* configuration.client.port should be a null."
91+
`;
92+
7693
exports[`options validate should throw an error on the "client" option with '{"progress":""}' value 1`] = `
7794
"ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
7895
- configuration.client.progress should be a boolean.

test/__snapshots__/validate-options.test.js.snap.webpack5

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,23 @@ exports[`options validate should throw an error on the "client" option with '{"o
7373
-> Show a full-screen overlay in the browser when there are compiler warnings."
7474
`;
7575

76+
exports[`options validate should throw an error on the "client" option with '{"path":true}' value 1`] = `
77+
"ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
78+
- configuration.client.path should be a string.
79+
-> Tells clients connected to devServer to use the provided path to connect."
80+
`;
81+
82+
exports[`options validate should throw an error on the "client" option with '{"port":true}' value 1`] = `
83+
"ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
84+
- configuration.client.port should be one of these:
85+
number | string | null
86+
-> Tells clients connected to devServer to use the provided port.
87+
Details:
88+
* configuration.client.port should be a number.
89+
* configuration.client.port should be a string.
90+
* configuration.client.port should be a null."
91+
`;
92+
7693
exports[`options validate should throw an error on the "client" option with '{"progress":""}' value 1`] = `
7794
"ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
7895
- configuration.client.progress should be a boolean.

test/validate-options.test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,12 @@ const tests = {
141141
{
142142
needHotEntry: [''],
143143
},
144+
{
145+
path: true,
146+
},
147+
{
148+
port: true,
149+
},
144150
],
145151
},
146152
compress: {

0 commit comments

Comments
 (0)