Skip to content

Commit d606cc1

Browse files
test: update
1 parent d3c4b97 commit d606cc1

5 files changed

+78
-36
lines changed

lib/options.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@
415415
},
416416
"public": {
417417
"type": "string",
418-
"description": "When using inline mode and you're proxying dev-server, the inline client script does not always know where to connect to. It will try to guess the URL of the server based on window.location, but if that fails you'll need to use this. https://webpack.js.org/configuration/dev-server/#devserverpublic"
418+
"description": "When using dev server and you're proxying dev-server, the client script does not always know where to connect to. It will try to guess the URL of the server based on window.location, but if that fails you'll need to use this. https://webpack.js.org/configuration/dev-server/#devserverpublic"
419419
},
420420
"setupExitSignals": {
421421
"type": "boolean",
@@ -447,7 +447,7 @@
447447
"minItems": 1
448448
}
449449
],
450-
"description": "It is possible to configure advanced options for serving static files from contentBase. See the Express documentation for the possible options. https://webpack.js.org/configuration/dev-server/#devserverstatic"
450+
"description": "It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options. https://webpack.js.org/configuration/dev-server/#devserverstatic"
451451
},
452452
"transportMode": {
453453
"anyOf": [

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

+38-11
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
exports[`options validate should throw an error on the "bonjour" option with '' value 1`] = `
44
"ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
5-
- configuration.bonjour should be a boolean."
5+
- configuration.bonjour should be a boolean.
6+
-> Broadcasts the server via ZeroConf networking on start. https://webpack.js.org/configuration/dev-server/#devserverbonjour"
67
`;
78

89
exports[`options validate should throw an error on the "client" option with '{"host":true,"path":"","port":8080}' value 1`] = `
@@ -68,30 +69,35 @@ exports[`options validate should throw an error on the "client" option with '{"p
6869
exports[`options validate should throw an error on the "client" option with '{"unknownOption":true}' value 1`] = `
6970
"ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
7071
- configuration.client has an unknown property 'unknownOption'. These properties are valid:
71-
object { host?, path?, port?, logging?, progress?, overlay?, needClientEntry?, needHotEntry? }"
72+
object { host?, path?, port?, logging?, progress?, overlay?, needClientEntry?, needHotEntry? }
73+
-> Specifies client properties. https://webpack.js.org/configuration/dev-server/#devserverclient"
7274
`;
7375

7476
exports[`options validate should throw an error on the "client" option with 'whoops!' value 1`] = `
7577
"ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
7678
- configuration.client should be an object:
77-
object { host?, path?, port?, logging?, progress?, overlay?, needClientEntry?, needHotEntry? }"
79+
object { host?, path?, port?, logging?, progress?, overlay?, needClientEntry?, needHotEntry? }
80+
-> Specifies client properties. https://webpack.js.org/configuration/dev-server/#devserverclient"
7881
`;
7982

8083
exports[`options validate should throw an error on the "compress" option with '' value 1`] = `
8184
"ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
82-
- configuration.compress should be a boolean."
85+
- configuration.compress should be a boolean.
86+
-> Enable gzip compression for everything served. https://webpack.js.org/configuration/dev-server/#devservercompress"
8387
`;
8488

8589
exports[`options validate should throw an error on the "dev" option with '' value 1`] = `
8690
"ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
8791
- configuration.dev should be an object:
88-
object { … }"
92+
object { … }
93+
-> The bundled files will be available in the browser under this path. https://webpack.js.org/configuration/dev-server/#devserverdev-"
8994
`;
9095

9196
exports[`options validate should throw an error on the "firewall" option with '' value 1`] = `
9297
"ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
9398
- configuration.firewall should be one of these:
9499
boolean | [string, ...] (should not have fewer than 1 item)
100+
-> Defines routes which are enabled by default, on by default and allows localhost. https://webpack.js.org/configuration/dev-server/#devserverfirewall
95101
Details:
96102
* configuration.firewall should be a boolean.
97103
* configuration.firewall should be an array:
@@ -106,13 +112,15 @@ exports[`options validate should throw an error on the "firewall" option with '[
106112
exports[`options validate should throw an error on the "headers" option with 'false' value 1`] = `
107113
"ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
108114
- configuration.headers should be an object:
109-
object { … }"
115+
object { … }
116+
-> Adds headers to all responses. https://webpack.js.org/configuration/dev-server/#devserverheaders"
110117
`;
111118

112119
exports[`options validate should throw an error on the "historyApiFallback" option with '' value 1`] = `
113120
"ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
114121
- configuration.historyApiFallback should be one of these:
115122
boolean | object { … }
123+
-> When using the HTML5 History API, the index.html page will likely have to be served in place of any 404 responses. https://webpack.js.org/configuration/dev-server/#devserverhistoryapifallback
116124
Details:
117125
* configuration.historyApiFallback should be a boolean.
118126
* configuration.historyApiFallback should be an object:
@@ -123,6 +131,7 @@ exports[`options validate should throw an error on the "host" option with 'false
123131
"ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
124132
- configuration.host should be one of these:
125133
string | null
134+
-> Specify a host to use. If you want your server to be accessible externally. https://webpack.js.org/configuration/dev-server/#devserverhost
126135
Details:
127136
* configuration.host should be a string.
128137
* configuration.host should be a null."
@@ -132,6 +141,7 @@ exports[`options validate should throw an error on the "hot" option with '' valu
132141
"ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
133142
- configuration.hot should be one of these:
134143
boolean | \\"only\\"
144+
-> Enable webpack's Hot Module Replacement feature. https://webpack.js.org/configuration/dev-server/#devserverhot
135145
Details:
136146
* configuration.hot should be a boolean.
137147
* configuration.hot should be \\"only\\"."
@@ -141,20 +151,23 @@ exports[`options validate should throw an error on the "hot" option with 'foo' v
141151
"ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
142152
- configuration.hot should be one of these:
143153
boolean | \\"only\\"
154+
-> Enable webpack's Hot Module Replacement feature. https://webpack.js.org/configuration/dev-server/#devserverhot
144155
Details:
145156
* configuration.hot should be a boolean.
146157
* configuration.hot should be \\"only\\"."
147158
`;
148159

149160
exports[`options validate should throw an error on the "http2" option with '' value 1`] = `
150161
"ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
151-
- configuration.http2 should be a boolean."
162+
- configuration.http2 should be a boolean.
163+
-> Serve over HTTP/2 using spdy. https://webpack.js.org/configuration/dev-server/#devserverhttp2"
152164
`;
153165

154166
exports[`options validate should throw an error on the "https" option with '' value 1`] = `
155167
"ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
156168
- configuration.https should be one of these:
157169
boolean | object { passphrase?, requestCert?, ca?, key?, pfx?, cert? }
170+
-> By default, dev-server will be served over HTTP. It can optionally be served over HTTP/2 with HTTPS. https://webpack.js.org/configuration/dev-server/#devserverhttps
158171
Details:
159172
* configuration.https should be a boolean.
160173
* configuration.https should be an object:
@@ -169,17 +182,20 @@ exports[`options validate should throw an error on the "https" option with '{"fo
169182

170183
exports[`options validate should throw an error on the "onAfterSetupMiddleware" option with 'false' value 1`] = `
171184
"ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
172-
- configuration.onAfterSetupMiddleware should be an instance of function."
185+
- configuration.onAfterSetupMiddleware should be an instance of function.
186+
-> Provides the ability to execute custom middleware after all other middleware internally within the server. https://webpack.js.org/configuration/dev-server/#devserverafter"
173187
`;
174188

175189
exports[`options validate should throw an error on the "onBeforeSetupMiddleware" option with 'false' value 1`] = `
176190
"ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
177-
- configuration.onBeforeSetupMiddleware should be an instance of function."
191+
- configuration.onBeforeSetupMiddleware should be an instance of function.
192+
-> Provides the ability to execute custom middleware prior to all other middleware internally within the server. https://webpack.js.org/configuration/dev-server/#devserverbefore"
178193
`;
179194

180195
exports[`options validate should throw an error on the "onListening" option with '' value 1`] = `
181196
"ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
182-
- configuration.onListening should be an instance of function."
197+
- configuration.onListening should be an instance of function.
198+
-> Provides an option to execute a custom function when webpack-dev-server starts listening for connections on a port. https://webpack.js.org/configuration/dev-server/#onlistening"
183199
`;
184200

185201
exports[`options validate should throw an error on the "open" option with '' value 1`] = `
@@ -202,6 +218,7 @@ exports[`options validate should throw an error on the "port" option with 'false
202218
"ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
203219
- configuration.port should be one of these:
204220
number | string | null
221+
-> Specify a port number to listen for requests on. https://webpack.js.org/configuration/dev-server/#devserverport
205222
Details:
206223
* configuration.port should be a number.
207224
* configuration.port should be a string.
@@ -217,6 +234,7 @@ exports[`options validate should throw an error on the "proxy" option with 'fals
217234
"ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
218235
- configuration.proxy should be one of these:
219236
object { … } | [object { … } | function, ...] (should not have fewer than 1 item)
237+
-> Proxying some URLs can be useful when you have a separate API backend development server and you want to send API requests on the same domain. https://webpack.js.org/configuration/dev-server/#devserverproxy
220238
Details:
221239
* configuration.proxy should be an object:
222240
object { … }
@@ -228,6 +246,7 @@ exports[`options validate should throw an error on the "proxy" option with 'func
228246
"ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
229247
- configuration.proxy should be one of these:
230248
object { … } | [object { … } | function, ...] (should not have fewer than 1 item)
249+
-> Proxying some URLs can be useful when you have a separate API backend development server and you want to send API requests on the same domain. https://webpack.js.org/configuration/dev-server/#devserverproxy
231250
Details:
232251
* configuration.proxy should be an object:
233252
object { … }
@@ -237,7 +256,8 @@ exports[`options validate should throw an error on the "proxy" option with 'func
237256

238257
exports[`options validate should throw an error on the "public" option with 'false' value 1`] = `
239258
"ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
240-
- configuration.public should be a string."
259+
- configuration.public should be a string.
260+
-> When using dev server and you're proxying dev-server, the client script does not always know where to connect to. It will try to guess the URL of the server based on window.location, but if that fails you'll need to use this. https://webpack.js.org/configuration/dev-server/#devserverpublic"
241261
`;
242262

243263
exports[`options validate should throw an error on the "static" option with '' value 1`] = `
@@ -249,6 +269,7 @@ exports[`options validate should throw an error on the "static" option with '0'
249269
"ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
250270
- configuration.static should be one of these:
251271
boolean | non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? } | [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] (should not have fewer than 1 item)
272+
-> It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options. https://webpack.js.org/configuration/dev-server/#devserverstatic
252273
Details:
253274
* configuration.static should be a boolean.
254275
* configuration.static should be a non-empty string.
@@ -262,6 +283,7 @@ exports[`options validate should throw an error on the "static" option with 'nul
262283
"ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
263284
- configuration.static should be one of these:
264285
boolean | non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? } | [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] (should not have fewer than 1 item)
286+
-> It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options. https://webpack.js.org/configuration/dev-server/#devserverstatic
265287
Details:
266288
* configuration.static should be a boolean.
267289
* configuration.static should be a non-empty string.
@@ -281,6 +303,7 @@ exports[`options validate should throw an error on the "transportMode" option wi
281303
"ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
282304
- configuration.transportMode should be one of these:
283305
object { client?, server? } | \\"sockjs\\" | \\"ws\\"
306+
-> This option allows us either to choose the current devServer transport mode for client/server individually or to provide custom client/server implementation. https://webpack.js.org/configuration/dev-server/#devservertransportmode
284307
Details:
285308
* configuration.transportMode.server should be one of these:
286309
string | function
@@ -298,6 +321,7 @@ exports[`options validate should throw an error on the "transportMode" option wi
298321
"ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
299322
- configuration.transportMode should be one of these:
300323
object { client?, server? } | \\"sockjs\\" | \\"ws\\"
324+
-> This option allows us either to choose the current devServer transport mode for client/server individually or to provide custom client/server implementation. https://webpack.js.org/configuration/dev-server/#devservertransportmode
301325
Details:
302326
* configuration.transportMode should be an object:
303327
object { client?, server? }
@@ -309,6 +333,7 @@ exports[`options validate should throw an error on the "transportMode" option wi
309333
"ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
310334
- configuration.transportMode should be one of these:
311335
object { client?, server? } | \\"sockjs\\" | \\"ws\\"
336+
-> This option allows us either to choose the current devServer transport mode for client/server individually or to provide custom client/server implementation. https://webpack.js.org/configuration/dev-server/#devservertransportmode
312337
Details:
313338
* configuration.transportMode should be an object:
314339
object { client?, server? }
@@ -320,6 +345,7 @@ exports[`options validate should throw an error on the "watchFiles" option with
320345
"ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
321346
- configuration.watchFiles should be one of these:
322347
non-empty string | object { paths?, options? } | [non-empty string | object { paths?, options? }, ...]
348+
-> List of files to watch for file changes and serve. https://webpack.js.org/configuration/dev-server/#devserverwatchfiles
323349
Details:
324350
* configuration.watchFiles should be a non-empty string.
325351
* configuration.watchFiles should be an object:
@@ -332,6 +358,7 @@ exports[`options validate should throw an error on the "watchFiles" option with
332358
"ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
333359
- configuration.watchFiles should be one of these:
334360
non-empty string | object { paths?, options? } | [non-empty string | object { paths?, options? }, ...]
361+
-> List of files to watch for file changes and serve. https://webpack.js.org/configuration/dev-server/#devserverwatchfiles
335362
Details:
336363
* configuration.watchFiles should be a non-empty string.
337364
* configuration.watchFiles should be an object:

0 commit comments

Comments
 (0)