Skip to content

Commit b0e9c36

Browse files
committed
test: fix
1 parent 6b87661 commit b0e9c36

File tree

5 files changed

+32
-3
lines changed

5 files changed

+32
-3
lines changed

lib/Server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ class Server {
482482
options.client.reconnect = 10;
483483
} else if (options.client.reconnect === true) {
484484
options.client.reconnect = Infinity;
485-
} else {
485+
} else if (options.client.reconnect === false) {
486486
options.client.reconnect = 0;
487487
}
488488

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ Options:
6363
--client-logging <value> Allows to specify options for client script in the browser or disable client script.
6464
--client-progress Prints compilation progress in percentage in the browser.
6565
--no-client-progress Does not print compilation progress in percentage in the browser.
66-
--client-reconnect [value] Tells dev-server the number of times it should try to reconnect the client.
67-
--no-client-reconnect Negative 'client-reconnect' option.
6866
--client-overlay Enables a full-screen overlay in the browser when there are compiler errors or warnings.
6967
--no-client-overlay Disables a full-screen overlay in the browser when there are compiler errors or warnings.
7068
--client-overlay-errors Enables a full-screen overlay in the browser when there are compiler errors.
7169
--no-client-overlay-errors Negative 'client-overlay-errors' option.
7270
--client-overlay-warnings Enables a full-screen overlay in the browser when there are compiler warnings.
7371
--no-client-overlay-warnings Negative 'client-overlay-warnings' option.
72+
--client-reconnect [value] Tells dev-server the number of times it should try to reconnect the client.
73+
--no-client-reconnect Tells dev-server to not to try to connect the client.
7474
--client-web-socket-url <value> Allows to specify URL to web socket server (useful when you're proxying dev server and client script does not always know where to connect to).
7575
--client-web-socket-url-hostname <value> Tells clients connected to devServer to use the provided hostname.
7676
--client-web-socket-url-port <value> Tells clients connected to devServer to use the provided port.

test/cli/client-option.test.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,33 @@ describe('"client" CLI option', () => {
105105
expect(exitCode).toEqual(0);
106106
});
107107

108+
it('should work using "--client-reconnect"', async () => {
109+
const { exitCode } = await testBin(["--port", port, "--client-reconnect"]);
110+
111+
expect(exitCode).toEqual(0);
112+
});
113+
114+
it('should work using "--client-reconnect <value>"', async () => {
115+
const { exitCode } = await testBin([
116+
"--port",
117+
port,
118+
"--client-reconnect",
119+
5,
120+
]);
121+
122+
expect(exitCode).toEqual(0);
123+
});
124+
125+
it('should work using "--no-client-reconnect"', async () => {
126+
const { exitCode } = await testBin([
127+
"--port",
128+
port,
129+
"--no-client-reconnect",
130+
]);
131+
132+
expect(exitCode).toEqual(0);
133+
});
134+
108135
it('should work using "--client-web-socket-url"', async () => {
109136
const { exitCode } = await testBin([
110137
"--port",

test/e2e/__snapshots__/server-and-client-transport.test.js.snap.webpack4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ Array [
7272
"[webpack-dev-server] Hot Module Replacement enabled.",
7373
"liveReload",
7474
"[webpack-dev-server] Live Reloading enabled.",
75+
"reconnect",
7576
"overlay",
7677
"hash",
7778
"ok",

test/e2e/__snapshots__/server-and-client-transport.test.js.snap.webpack5

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ Array [
7272
"[webpack-dev-server] Hot Module Replacement enabled.",
7373
"liveReload",
7474
"[webpack-dev-server] Live Reloading enabled.",
75+
"reconnect",
7576
"overlay",
7677
"hash",
7778
"ok",

0 commit comments

Comments
 (0)