diff --git a/test/e2e/__snapshots__/host-and-port.test.js.snap.webpack4 b/test/e2e/__snapshots__/host-and-port.test.js.snap.webpack4 index 3ad1b123b1..72d0a2021e 100644 --- a/test/e2e/__snapshots__/host-and-port.test.js.snap.webpack4 +++ b/test/e2e/__snapshots__/host-and-port.test.js.snap.webpack4 @@ -1,5 +1,38 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`host and port should work using "0.0.0.0" host and "auto" port: console messages 1`] = ` +Array [ + "[HMR] Waiting for update signal from WDS...", + "Hey.", + "[webpack-dev-server] Hot Module Replacement enabled.", + "[webpack-dev-server] Live Reloading enabled.", +] +`; + +exports[`host and port should work using "0.0.0.0" host and "auto" port: page errors 1`] = `Array []`; + +exports[`host and port should work using "0.0.0.0" host and port as number: console messages 1`] = ` +Array [ + "[HMR] Waiting for update signal from WDS...", + "Hey.", + "[webpack-dev-server] Hot Module Replacement enabled.", + "[webpack-dev-server] Live Reloading enabled.", +] +`; + +exports[`host and port should work using "0.0.0.0" host and port as number: page errors 1`] = `Array []`; + +exports[`host and port should work using "0.0.0.0" host and port as string: console messages 1`] = ` +Array [ + "[HMR] Waiting for update signal from WDS...", + "Hey.", + "[webpack-dev-server] Hot Module Replacement enabled.", + "[webpack-dev-server] Live Reloading enabled.", +] +`; + +exports[`host and port should work using "0.0.0.0" host and port as string: page errors 1`] = `Array []`; + exports[`host and port should work using "127.0.0.1" host and "auto" port: console messages 1`] = ` Array [ "[HMR] Waiting for update signal from WDS...", diff --git a/test/e2e/__snapshots__/host-and-port.test.js.snap.webpack5 b/test/e2e/__snapshots__/host-and-port.test.js.snap.webpack5 index 3ad1b123b1..72d0a2021e 100644 --- a/test/e2e/__snapshots__/host-and-port.test.js.snap.webpack5 +++ b/test/e2e/__snapshots__/host-and-port.test.js.snap.webpack5 @@ -1,5 +1,38 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`host and port should work using "0.0.0.0" host and "auto" port: console messages 1`] = ` +Array [ + "[HMR] Waiting for update signal from WDS...", + "Hey.", + "[webpack-dev-server] Hot Module Replacement enabled.", + "[webpack-dev-server] Live Reloading enabled.", +] +`; + +exports[`host and port should work using "0.0.0.0" host and "auto" port: page errors 1`] = `Array []`; + +exports[`host and port should work using "0.0.0.0" host and port as number: console messages 1`] = ` +Array [ + "[HMR] Waiting for update signal from WDS...", + "Hey.", + "[webpack-dev-server] Hot Module Replacement enabled.", + "[webpack-dev-server] Live Reloading enabled.", +] +`; + +exports[`host and port should work using "0.0.0.0" host and port as number: page errors 1`] = `Array []`; + +exports[`host and port should work using "0.0.0.0" host and port as string: console messages 1`] = ` +Array [ + "[HMR] Waiting for update signal from WDS...", + "Hey.", + "[webpack-dev-server] Hot Module Replacement enabled.", + "[webpack-dev-server] Live Reloading enabled.", +] +`; + +exports[`host and port should work using "0.0.0.0" host and port as string: page errors 1`] = `Array []`; + exports[`host and port should work using "127.0.0.1" host and "auto" port: console messages 1`] = ` Array [ "[HMR] Waiting for update signal from WDS...", diff --git a/test/e2e/host-and-port.test.js b/test/e2e/host-and-port.test.js index 4b2c41854d..cbbf8da166 100644 --- a/test/e2e/host-and-port.test.js +++ b/test/e2e/host-and-port.test.js @@ -8,8 +8,8 @@ const runBrowser = require("../helpers/run-browser"); const port = require("../ports-map")["host-and-port"]; describe("host and port", () => { - // TODO: add "0.0.0.0" and "local-ipv6" - const hosts = ["localhost", "127.0.0.1", "local-ip", "local-ipv4"]; + // TODO: add "local-ipv6" + const hosts = ["0.0.0.0", "localhost", "127.0.0.1", "local-ip", "local-ipv4"]; for (const host of hosts) { it(`should work using "${host}" host and port as number`, async () => { @@ -18,7 +18,9 @@ describe("host and port", () => { let hostname = host; - if (hostname === "local-ip" || hostname === "local-ipv4") { + if (hostname === "0.0.0.0") { + hostname = "127.0.0.1"; + } else if (hostname === "local-ip" || hostname === "local-ipv4") { hostname = internalIp.v4.sync(); } @@ -57,7 +59,9 @@ describe("host and port", () => { let hostname = host; - if (hostname === "local-ip" || hostname === "local-ipv4") { + if (hostname === "0.0.0.0") { + hostname = "127.0.0.1"; + } else if (hostname === "local-ip" || hostname === "local-ipv4") { hostname = internalIp.v4.sync(); } @@ -99,7 +103,9 @@ describe("host and port", () => { let hostname = host; - if (hostname === "local-ip" || hostname === "local-ipv4") { + if (hostname === "0.0.0.0") { + hostname = "127.0.0.1"; + } else if (hostname === "local-ip" || hostname === "local-ipv4") { hostname = internalIp.v4.sync(); }