Skip to content

Commit fdf550b

Browse files
committed
test: update snapshot
1 parent 3a41331 commit fdf550b

File tree

2 files changed

+63
-89
lines changed

2 files changed

+63
-89
lines changed

test/cli/__snapshots__/cli.test.js.snap.webpack4

Lines changed: 59 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -186,94 +186,57 @@ exports[`CLI should generate correct cli flags 1`] = `
186186
Run the webpack dev server.
187187

188188
Options:
189-
-c, --config <value...> Provide path to a webpack configuration
190-
file e.g. ./webpack.config.js.
189+
-c, --config <value...> Provide path to a webpack configuration file e.g. ./webpack.config.js.
191190
--config-name <value...> Name of the configuration to use.
192-
-m, --merge Merge two or more configurations using
193-
'webpack-merge'.
194-
--env <value...> Environment passed to the configuration
195-
when it is a function.
196-
--node-env <value> Sets process.env.NODE_ENV to the specified
197-
value.
191+
-m, --merge Merge two or more configurations using 'webpack-merge'.
192+
--env <value...> Environment passed to the configuration when it is a function.
193+
--node-env <value> Sets process.env.NODE_ENV to the specified value.
198194
--progress [value] Print compilation progress during build.
199-
-j, --json [value] Prints result as JSON or store it in a
200-
file.
201-
--entry <value...> The entry point(s) of your application e.g.
202-
./src/main.js.
203-
-o, --output-path <value> Output location of the file generated by
204-
webpack e.g. ./dist/.
195+
-j, --json [value] Prints result as JSON or store it in a file.
196+
--entry <value...> The entry point(s) of your application e.g. ./src/main.js.
197+
-o, --output-path <value> Output location of the file generated by webpack e.g. ./dist/.
205198
-t, --target <value> Sets the build target e.g. node.
206199
-d, --devtool <value> Determine source maps to use.
207200
--no-devtool Do not generate source maps.
208201
--mode <value> Defines the mode to pass to webpack.
209-
--name <value> Name of the configuration. Used when
210-
loading multiple configurations.
211-
--stats [value] It instructs webpack on how to treat the
212-
stats e.g. verbose.
202+
--name <value> Name of the configuration. Used when loading multiple configurations.
203+
--stats [value] It instructs webpack on how to treat the stats e.g. verbose.
213204
--no-stats Disable stats output.
214205
--watch-options-stdin Stop watching when stdin stream has ended.
215-
--no-watch-options-stdin Do not stop watching when stdin stream has
216-
ended.
217-
--bonjour Broadcasts the server via ZeroConf
218-
networking on start.
219-
--no-bonjour Do not broadcast the server via ZeroConf
220-
networking on start.
221-
--client-transport <value> Allows to set custom transport to
222-
communicate with server.
223-
--client-host <value> Tells clients connected to devServer to use
224-
the provided host.
225-
--client-path <value> Tells clients connected to devServer to use
226-
the provided path to connect.
227-
--client-port <value> Tells clients connected to devServer to use
228-
the provided port.
206+
--no-watch-options-stdin Do not stop watching when stdin stream has ended.
207+
--bonjour Broadcasts the server via ZeroConf networking on start.
208+
--no-bonjour Do not broadcast the server via ZeroConf networking on start.
209+
--client-transport <value> Allows to set custom transport to communicate with server.
210+
--client-host <value> Tells clients connected to devServer to use the provided host.
211+
--client-path <value> Tells clients connected to devServer to use the provided path to connect.
212+
--client-port <value> Tells clients connected to devServer to use the provided port.
229213
--client-logging <value> Specifies client properties.
230-
--client-progress Print compilation progress in percentage in
231-
the browser.
232-
--no-client-progress Do not print compilation progress in
233-
percentage in the browser.
234-
--client-overlay Show a full-screen overlay in the browser
235-
when there are compiler errors or warnings.
236-
--no-client-overlay Do not show a full-screen overlay in the
237-
browser when there are compiler errors or
238-
warnings.
239-
--client-overlay-errors Show a full-screen overlay in the browser
240-
when there are compiler errors.
214+
--client-progress Print compilation progress in percentage in the browser.
215+
--no-client-progress Do not print compilation progress in percentage in the browser.
216+
--client-overlay Show a full-screen overlay in the browser when there are compiler errors or warnings.
217+
--no-client-overlay Do not show a full-screen overlay in the browser when there are compiler errors or warnings.
218+
--client-overlay-errors Show a full-screen overlay in the browser when there are compiler errors.
241219
--no-client-overlay-errors Negative 'client-overlay-errors' option.
242-
--client-overlay-warnings Show a full-screen overlay in the browser
243-
when there are compiler warnings.
220+
--client-overlay-warnings Show a full-screen overlay in the browser when there are compiler warnings.
244221
--no-client-overlay-warnings Negative 'client-overlay-warnings' option.
245222
--client-need-client-entry Tells devServer to inject a client entry.
246223
--no-client-need-client-entry Negative 'client-need-client-entry' option.
247-
--client-hot-entry Tells devServer to inject a Hot Module
248-
Replacement entry.
249-
--no-client-hot-entry Do not tell devServer to inject a Hot
250-
Module Replacement entry.
251-
--web-socket-server <value> Allows to set web socket server and
252-
options.
253-
--web-socket-server-type <value> Allows to set web socket server and
254-
options.
255-
--compress Enable gzip compression for everything
256-
served.
224+
--client-hot-entry Tells devServer to inject a Hot Module Replacement entry.
225+
--no-client-hot-entry Do not tell devServer to inject a Hot Module Replacement entry.
226+
--web-socket-server <value> Allows to set web socket server and options.
227+
--web-socket-server-type <value> Allows to set web socket server and options.
228+
--compress Enable gzip compression for everything served.
257229
--no-compress Disable gzip compression.
258-
--firewall [value...] Defines routes which are enabled by
259-
default, on by default and allows
260-
localhost.
230+
--firewall [value...] Defines routes which are enabled by default, on by default and allows localhost.
261231
--no-firewall Disable firewall.
262-
--history-api-fallback When using the HTML5 History API, the
263-
index.html page will likely have to be
264-
served in place of any 404 responses.
232+
--history-api-fallback When using the HTML5 History API, the index.html page will likely have to be served in place of any 404 responses.
265233
--no-history-api-fallback Negative 'history-api-fallback' option.
266-
--host <value> Specify a host to use. If you want your
267-
server to be accessible externally.
268-
--hot [value] Enable webpack's Hot Module Replacement
269-
feature.
270-
--no-hot Disable webpack's Hot Module Replacement
271-
feature.
234+
--host <value> Specify a host to use. If you want your server to be accessible externally.
235+
--hot [value] Enable webpack's Hot Module Replacement feature.
236+
--no-hot Disable webpack's Hot Module Replacement feature.
272237
--http2 Serve over HTTP/2 using spdy.
273238
--no-http2 Do not use HTTP/2.
274-
--https By default, dev-server will be served over
275-
HTTP. It can optionally be served over
276-
HTTP/2 with HTTPS.
239+
--https By default, dev-server will be served over HTTP. It can optionally be served over HTTP/2 with HTTPS.
277240
--no-https Do not use HTTPS protocol.
278241
--https-passphrase <value> Passphrase for a pfx file.
279242
--https-request-cert Request for an SSL certificate.
@@ -282,28 +245,36 @@ Options:
282245
--https-key <value> Path to an SSL key.
283246
--https-pfx <value> Path to an SSL pfx file.
284247
--https-cert <value> Path to an SSL certificate.
285-
--live-reload By default, the dev-server will
286-
reload/refresh the page when file changes
287-
are detected.
248+
--live-reload By default, the dev-server will reload/refresh the page when file changes are detected.
288249
--no-live-reload Disables live reloading on changing files.
289-
--open [value...] Tells dev-server to open the browser after
290-
server had been started. Set it to true to
291-
open your default browser.
250+
--open [value...] Tells dev-server to open the browser after server had been started. Set it to true to open your default browser.
292251
--no-open Do not open the default browser.
293252
--open-target [value...] Open specified route in browser.
294253
--no-open-target Do not open specified route in browser.
295254
--open-app-name <value...> Open specified browser.
296255
--open-app <value> Open specified browser.
297-
--port <value> Specify a port number to listen for
298-
requests on.
299-
--public <value> When using dev server and you're proxying
300-
dev-server, the client script does not
301-
always know where to connect to. It will
302-
try to guess the URL of the server based on
303-
window.location, but if that fails you'll
304-
need to use this.
305-
--static [value...] It is possible to configure advanced
306-
options for serving static files from
307-
directory. See the Express documentation
308-
for the possibl"
256+
--port <value> Specify a port number to listen for requests on.
257+
--public <value> 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.
258+
--static [value...] It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options.
259+
--no-static Negative 'static' option.
260+
--static-directory <value> Directory for static contents.
261+
--static-public-path <value...> The bundled files will be available in the browser under this path.
262+
--static-serve-index Tells dev-server to use serveIndex middleware when enabled.
263+
--no-static-serve-index Do not tell dev-server to use serveIndex middleware.
264+
--static-watch Watch for files in static content directory.
265+
--no-static-watch Do not watch for files in static content directory.
266+
--watch-files <value...> List of files to watch for file changes and serve.
267+
--watch-files-paths <value...> List of files to watch for file changes and serve.
268+
269+
Global options:
270+
--color Enable colors on console.
271+
--no-color Disable colors on console.
272+
-v, --version Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands.
273+
-h, --help [verbose] Display help for commands and options.
274+
275+
To see list of all supported commands and options run 'webpack --help=verbose'.
276+
277+
Webpack documentation: https://webpack.js.org/.
278+
CLI documentation: https://webpack.js.org/api/cli/.
279+
Made with ♥ by the webpack team."
309280
`;

test/helpers/test-bin.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ const basicConfigPath = path.resolve(
1616

1717
function testBin(testArgs, configPath) {
1818
const cwd = process.cwd();
19-
const env = process.env.NODE_ENV;
19+
const env = {
20+
WEBPACK_CLI_HELP_WIDTH: 1024,
21+
NODE_ENV: process.env.NODE_ENV,
22+
};
2023

2124
if (!configPath) {
2225
configPath = basicConfigPath;

0 commit comments

Comments
 (0)