From 98eda2d451c0494d2a89da421b95282dc54ed71b Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Thu, 8 May 2025 16:41:23 +0530 Subject: [PATCH 1/5] ci: add Node.js v24 --- .github/workflows/nodejs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index d6ef806925..24289f5388 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -69,7 +69,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] - node-version: [18.x, 20.x, 22.x, 23.x] + node-version: [18.x, 20.x, 22.x, 24.x] shard: ["1/4", "2/4", "3/4", "4/4"] webpack-version: [latest] From 7ba54a26076571f37900b2eb75352dd6e5aa2fbd Mon Sep 17 00:00:00 2001 From: alexander-akait Date: Wed, 21 May 2025 15:13:08 +0300 Subject: [PATCH 2/5] test: fix --- test/cli/server-option.test.js | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/test/cli/server-option.test.js b/test/cli/server-option.test.js index 9400a08161..a54b476383 100644 --- a/test/cli/server-option.test.js +++ b/test/cli/server-option.test.js @@ -46,19 +46,24 @@ describe('"server" CLI options', () => { ).toMatchSnapshot(); }); - it('should work using "--server-type spdy"', async () => { - const { exitCode, stderr } = await testBin([ - "--port", - port, - "--server-type", - "spdy", - ]); - - expect(exitCode).toEqual(0); - expect( - normalizeStderr(stderr, { ipv6: true, https: true }), - ).toMatchSnapshot(); - }); + const [major] = process.versions.node.split(".").map(Number); + + (major >= 24 ? it.skip : it)( + 'should work using "--server-type spdy"', + async () => { + const { exitCode, stderr } = await testBin([ + "--port", + port, + "--server-type", + "spdy", + ]); + + expect(exitCode).toEqual(0); + expect( + normalizeStderr(stderr, { ipv6: true, https: true }), + ).toMatchSnapshot(); + }, + ); it('should work using "--server-options-key --server-options-pfx --server-options-passphrase webpack-dev-server --server-options-cert "', async () => { const pfxFile = path.join(httpsCertificateDirectory, "server.pfx"); From db3142f2903da2091464858f66ba07b3de3a895a Mon Sep 17 00:00:00 2001 From: alexander-akait Date: Wed, 21 May 2025 16:03:30 +0300 Subject: [PATCH 3/5] test: fix --- .../server.test.js.snap.webpack5 | 47 ------------------- test/e2e/server.test.js | 39 +++++++-------- 2 files changed, 16 insertions(+), 70 deletions(-) diff --git a/test/e2e/__snapshots__/server.test.js.snap.webpack5 b/test/e2e/__snapshots__/server.test.js.snap.webpack5 index dabcd21709..0f8208d2b1 100644 --- a/test/e2e/__snapshots__/server.test.js.snap.webpack5 +++ b/test/e2e/__snapshots__/server.test.js.snap.webpack5 @@ -523,42 +523,6 @@ exports[`server option as object should support the "requestCert" option should } `; -exports[`server option as object spdy server with options should handle GET request to index route (/): console messages 1`] = `[]`; - -exports[`server option as object spdy server with options should handle GET request to index route (/): https options 1`] = ` -{ - "ca": [ - "", - ], - "cert": [ - "", - ], - "key": [ - "", - ], - "passphrase": "webpack-dev-server", - "pfx": [ - "", - ], - "requestCert": false, - "spdy": { - "protocols": [ - "h2", - "http/1.1", - ], - }, -} -`; - -exports[`server option as object spdy server with options should handle GET request to index route (/): page errors 1`] = `[]`; - -exports[`server option as object spdy server with options should handle GET request to index route (/): response status 1`] = `200`; - -exports[`server option as object spdy server with options should handle GET request to index route (/): response text 1`] = ` -"Heyo. -" -`; - exports[`server option as string custom-http should handle GET request to index route (/): console messages 1`] = `[]`; exports[`server option as string custom-http should handle GET request to index route (/): page errors 1`] = `[]`; @@ -591,14 +555,3 @@ exports[`server option as string https should handle GET request to index route "Heyo. " `; - -exports[`server option as string spdy should handle GET request to index route (/): console messages 1`] = `[]`; - -exports[`server option as string spdy should handle GET request to index route (/): page errors 1`] = `[]`; - -exports[`server option as string spdy should handle GET request to index route (/): response status 1`] = `200`; - -exports[`server option as string spdy should handle GET request to index route (/): response text 1`] = ` -"Heyo. -" -`; diff --git a/test/e2e/server.test.js b/test/e2e/server.test.js index 4324b5dbc0..f17f0e5627 100644 --- a/test/e2e/server.test.js +++ b/test/e2e/server.test.js @@ -4,7 +4,6 @@ const https = require("https"); const path = require("path"); const fs = require("graceful-fs"); const request = require("supertest"); -const spdy = require("spdy"); const webpack = require("webpack"); const Server = require("../../lib/Server"); const config = require("../fixtures/static-config/webpack.config"); @@ -24,6 +23,8 @@ const staticDirectory = path.resolve( "../fixtures/static-config/public", ); +const [major] = process.versions.node.split(".").map(Number); + describe("server option", () => { describe("as string", () => { let compiler; @@ -213,7 +214,7 @@ describe("server option", () => { }); }); - describe("spdy", () => { + (major >= 24 ? describe.skip : describe)("spdy", () => { beforeEach(async () => { compiler = webpack(config); @@ -260,16 +261,10 @@ describe("server option", () => { ); expect(HTTPVersion).toEqual("h2"); - - expect(response.status()).toMatchSnapshot("response status"); - - expect(await response.text()).toMatchSnapshot("response text"); - - expect( - consoleMessages.map((message) => message.text()), - ).toMatchSnapshot("console messages"); - - expect(pageErrors).toMatchSnapshot("page errors"); + expect(response.status()).toBe(200); + expect((await response.text()).trim()).toBe("Heyo."); + expect(consoleMessages).toHaveLength(0); + expect(pageErrors).toHaveLength(0); }); }); }); @@ -1281,7 +1276,7 @@ describe("server option", () => { }); }); - describe("spdy server with options", () => { + (major >= 24 ? describe.skip : describe)("spdy server with options", () => { let compiler; let server; let createServerSpy; @@ -1293,7 +1288,7 @@ describe("server option", () => { beforeEach(async () => { compiler = webpack(config); - createServerSpy = jest.spyOn(spdy, "createServer"); + createServerSpy = jest.spyOn(require("spdy"), "createServer"); server = new Server( { @@ -1349,16 +1344,14 @@ describe("server option", () => { () => performance.getEntries()[0].nextHopProtocol, ); + const options = normalizeOptions(createServerSpy.mock.calls[0][0]); + expect(HTTPVersion).toEqual("h2"); - expect( - normalizeOptions(createServerSpy.mock.calls[0][0]), - ).toMatchSnapshot("https options"); - expect(response.status()).toMatchSnapshot("response status"); - expect(await response.text()).toMatchSnapshot("response text"); - expect( - consoleMessages.map((message) => message.text()), - ).toMatchSnapshot("console messages"); - expect(pageErrors).toMatchSnapshot("page errors"); + expect(options.spdy).toEqual({ protocols: ["h2", "http/1.1"] }); + expect(response.status()).toBe(200); + expect((await response.text()).trim()).toBe("Heyo."); + expect(consoleMessages).toHaveLength(0); + expect(pageErrors).toHaveLength(0); }); }); From 036dece74fad0e846bd3219ea4adb13ea3ebaa35 Mon Sep 17 00:00:00 2001 From: alexander-akait Date: Wed, 21 May 2025 16:34:32 +0300 Subject: [PATCH 4/5] test: fix --- .../__snapshots__/app.test.js.snap.webpack5 | 309 ------------------ test/e2e/app.test.js | 30 +- 2 files changed, 23 insertions(+), 316 deletions(-) delete mode 100644 test/e2e/__snapshots__/app.test.js.snap.webpack5 diff --git a/test/e2e/__snapshots__/app.test.js.snap.webpack5 b/test/e2e/__snapshots__/app.test.js.snap.webpack5 deleted file mode 100644 index 182d9ce3f3..0000000000 --- a/test/e2e/__snapshots__/app.test.js.snap.webpack5 +++ /dev/null @@ -1,309 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`app option should work using "connect (async)" application and "http" server should handle GET request to index route (/): console messages 1`] = ` -[ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`app option should work using "connect (async)" application and "http" server should handle GET request to index route (/): page errors 1`] = `[]`; - -exports[`app option should work using "connect (async)" application and "http" server should handle GET request to index route (/): response status 1`] = `200`; - -exports[`app option should work using "connect (async)" application and "http" server should handle GET request to index route (/): response text 1`] = ` -" - - - - - webpack-dev-server - - -

webpack-dev-server is running...

- - - -" -`; - -exports[`app option should work using "connect" application and "http" server should handle GET request to index route (/): console messages 1`] = ` -[ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`app option should work using "connect" application and "http" server should handle GET request to index route (/): page errors 1`] = `[]`; - -exports[`app option should work using "connect" application and "http" server should handle GET request to index route (/): response status 1`] = `200`; - -exports[`app option should work using "connect" application and "http" server should handle GET request to index route (/): response text 1`] = ` -" - - - - - webpack-dev-server - - -

webpack-dev-server is running...

- - - -" -`; - -exports[`app option should work using "connect" application and "http2" server should handle GET request to index route (/): console messages 1`] = ` -[ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`app option should work using "connect" application and "http2" server should handle GET request to index route (/): page errors 1`] = `[]`; - -exports[`app option should work using "connect" application and "http2" server should handle GET request to index route (/): response status 1`] = `200`; - -exports[`app option should work using "connect" application and "http2" server should handle GET request to index route (/): response text 1`] = ` -" - - - - - webpack-dev-server - - -

webpack-dev-server is running...

- - - -" -`; - -exports[`app option should work using "connect" application and "https" server should handle GET request to index route (/): console messages 1`] = ` -[ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`app option should work using "connect" application and "https" server should handle GET request to index route (/): page errors 1`] = `[]`; - -exports[`app option should work using "connect" application and "https" server should handle GET request to index route (/): response status 1`] = `200`; - -exports[`app option should work using "connect" application and "https" server should handle GET request to index route (/): response text 1`] = ` -" - - - - - webpack-dev-server - - -

webpack-dev-server is running...

- - - -" -`; - -exports[`app option should work using "connect" application and "spdy" server should handle GET request to index route (/): console messages 1`] = ` -[ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`app option should work using "connect" application and "spdy" server should handle GET request to index route (/): page errors 1`] = `[]`; - -exports[`app option should work using "connect" application and "spdy" server should handle GET request to index route (/): response status 1`] = `200`; - -exports[`app option should work using "connect" application and "spdy" server should handle GET request to index route (/): response text 1`] = ` -" - - - - - webpack-dev-server - - -

webpack-dev-server is running...

- - - -" -`; - -exports[`app option should work using "express" application and "http" server should handle GET request to index route (/): console messages 1`] = ` -[ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`app option should work using "express" application and "http" server should handle GET request to index route (/): page errors 1`] = `[]`; - -exports[`app option should work using "express" application and "http" server should handle GET request to index route (/): response status 1`] = `200`; - -exports[`app option should work using "express" application and "http" server should handle GET request to index route (/): response text 1`] = ` -" - - - - - webpack-dev-server - - -

webpack-dev-server is running...

- - - -" -`; - -exports[`app option should work using "express" application and "https" server should handle GET request to index route (/): console messages 1`] = ` -[ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`app option should work using "express" application and "https" server should handle GET request to index route (/): page errors 1`] = `[]`; - -exports[`app option should work using "express" application and "https" server should handle GET request to index route (/): response status 1`] = `200`; - -exports[`app option should work using "express" application and "https" server should handle GET request to index route (/): response text 1`] = ` -" - - - - - webpack-dev-server - - -

webpack-dev-server is running...

- - - -" -`; - -exports[`app option should work using "express" application and "spdy" server should handle GET request to index route (/): console messages 1`] = ` -[ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`app option should work using "express" application and "spdy" server should handle GET request to index route (/): page errors 1`] = `[]`; - -exports[`app option should work using "express" application and "spdy" server should handle GET request to index route (/): response status 1`] = `200`; - -exports[`app option should work using "express" application and "spdy" server should handle GET request to index route (/): response text 1`] = ` -" - - - - - webpack-dev-server - - -

webpack-dev-server is running...

- - - -" -`; - -exports[`app option should work using "hono" application and "[object Object]" server should handle GET request to index route (/): console messages 1`] = ` -[ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`app option should work using "hono" application and "[object Object]" server should handle GET request to index route (/): page errors 1`] = `[]`; - -exports[`app option should work using "hono" application and "[object Object]" server should handle GET request to index route (/): response status 1`] = `200`; - -exports[`app option should work using "hono" application and "[object Object]" server should handle GET request to index route (/): response text 1`] = ` -" - - - - - webpack-dev-server - - -

webpack-dev-server is running...

- - - -" -`; - -exports[`app option should work using "hono" application and "custom server" server should handle GET request to index route (/): console messages 1`] = ` -[ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`app option should work using "hono" application and "custom server" server should handle GET request to index route (/): console messages 2`] = ` -[ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`app option should work using "hono" application and "custom server" server should handle GET request to index route (/): page errors 1`] = `[]`; - -exports[`app option should work using "hono" application and "custom server" server should handle GET request to index route (/): page errors 2`] = `[]`; - -exports[`app option should work using "hono" application and "custom server" server should handle GET request to index route (/): response status 1`] = `200`; - -exports[`app option should work using "hono" application and "custom server" server should handle GET request to index route (/): response status 2`] = `200`; - -exports[`app option should work using "hono" application and "custom server" server should handle GET request to index route (/): response text 1`] = ` -" - - - - - webpack-dev-server - - -

webpack-dev-server is running...

- - - -" -`; - -exports[`app option should work using "hono" application and "custom server" server should handle GET request to index route (/): response text 2`] = ` -" - - - - - webpack-dev-server - - -

webpack-dev-server is running...

- - - -" -`; diff --git a/test/e2e/app.test.js b/test/e2e/app.test.js index 138feae57b..c1ae5df786 100644 --- a/test/e2e/app.test.js +++ b/test/e2e/app.test.js @@ -17,10 +17,8 @@ const staticDirectory = path.resolve( const apps = [ ["express", () => require("express")(), "http"], ["express", () => require("express")(), "https"], - ["express", () => require("express")(), "spdy"], ["connect", () => require("connect")(), "http"], ["connect", () => require("connect")(), "https"], - ["connect", () => require("connect")(), "spdy"], ["connect", () => require("connect")(), "http2"], ["connect (async)", () => require("connect")(), "http"], [ @@ -89,6 +87,15 @@ const apps = [ ], ]; +const [major] = process.versions.node.split(".").map(Number); + +if (major < 24) { + apps.push( + ["express", () => require("express")(), "spdy"], + ["connect", () => require("connect")(), "spdy"], + ); +} + describe("app option", () => { for (const [appName, app, server, setupMiddlewares] of apps) { let compiler; @@ -169,12 +176,21 @@ describe("app option", () => { expect(HTTPVersion).toEqual("http/1.1"); } - expect(response.status()).toMatchSnapshot("response status"); - expect(await response.text()).toMatchSnapshot("response text"); + expect(response.status()).toBe(200); + + const text = await response.text(); + expect( - consoleMessages.map((message) => message.text()), - ).toMatchSnapshot("console messages"); - expect(pageErrors).toMatchSnapshot("page errors"); + text.includes( + '', + ), + ).toBe(true); + expect(consoleMessages.map((message) => message.text())).toEqual([ + "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", + "[HMR] Waiting for update signal from WDS...", + "Hey.", + ]); + expect(pageErrors).toHaveLength(0); }); }); } From b91880d3f5afe91471d868d7402a0435922882bc Mon Sep 17 00:00:00 2001 From: alexander-akait Date: Wed, 21 May 2025 16:56:19 +0300 Subject: [PATCH 5/5] test: fix --- ...eb-socket-server-url.test.js.snap.webpack5 | 20 --- test/e2e/web-socket-server-url.test.js | 159 +++++++++--------- 2 files changed, 83 insertions(+), 96 deletions(-) diff --git a/test/e2e/__snapshots__/web-socket-server-url.test.js.snap.webpack5 b/test/e2e/__snapshots__/web-socket-server-url.test.js.snap.webpack5 index a9b973e572..1341d5174e 100644 --- a/test/e2e/__snapshots__/web-socket-server-url.test.js.snap.webpack5 +++ b/test/e2e/__snapshots__/web-socket-server-url.test.js.snap.webpack5 @@ -269,26 +269,6 @@ exports[`web socket server URL should work with "server: 'https'" option ("ws"): exports[`web socket server URL should work with "server: 'https'" option ("ws"): page errors 1`] = `[]`; -exports[`web socket server URL should work with "server: 'spdy'" option ("sockjs"): console messages 1`] = ` -[ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with "server: 'spdy'" option ("sockjs"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with "server: 'spdy'" option ("ws"): console messages 1`] = ` -[ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with "server: 'spdy'" option ("ws"): page errors 1`] = `[]`; - exports[`web socket server URL should work with default "/ws" value of the "client.webSocketURL.pathname" option ("sockjs"): console messages 1`] = ` [ "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", diff --git a/test/e2e/web-socket-server-url.test.js b/test/e2e/web-socket-server-url.test.js index a193262fec..deea01f6d7 100644 --- a/test/e2e/web-socket-server-url.test.js +++ b/test/e2e/web-socket-server-url.test.js @@ -2344,83 +2344,90 @@ describe("web socket server URL", () => { } }); - it(`should work with "server: 'spdy'" option ("${webSocketServer}")`, async () => { - const hostname = "localhost"; - const compiler = webpack(config); - const devServerOptions = { - webSocketServer, - port: port1, - server: "spdy", - }; - const server = new Server(devServerOptions, compiler); - - await server.start(); - - const { page, browser } = await runBrowser(); - - try { - const pageErrors = []; - const consoleMessages = []; - - page - .on("console", (message) => { - consoleMessages.push(message); - }) - .on("pageerror", (error) => { - pageErrors.push(error); - }); - - const webSocketRequests = []; - - if (webSocketServer === "ws") { - const session = await page.target().createCDPSession(); - - session.on("Network.webSocketCreated", (test) => { - webSocketRequests.push(test); - }); - - await session.send("Target.setAutoAttach", { - autoAttach: true, - flatten: true, - waitForDebuggerOnStart: true, - }); - - sessionSubscribe(session); - } else { - page.on("request", (request) => { - if (/\/ws\//.test(request.url())) { - webSocketRequests.push({ url: request.url() }); - } - }); + const [major] = process.versions.node.split(".").map(Number); + + (major >= 24 ? it.skip : it)( + `should work with "server: 'spdy'" option ("${webSocketServer}")`, + async () => { + const hostname = "localhost"; + const compiler = webpack(config); + const devServerOptions = { + webSocketServer, + port: port1, + server: "spdy", + }; + const server = new Server(devServerOptions, compiler); + + await server.start(); + + const { page, browser } = await runBrowser(); + + try { + const pageErrors = []; + const consoleMessages = []; + + page + .on("console", (message) => { + consoleMessages.push(message); + }) + .on("pageerror", (error) => { + pageErrors.push(error); + }); + + const webSocketRequests = []; + + if (webSocketServer === "ws") { + const session = await page.target().createCDPSession(); + + session.on("Network.webSocketCreated", (test) => { + webSocketRequests.push(test); + }); + + await session.send("Target.setAutoAttach", { + autoAttach: true, + flatten: true, + waitForDebuggerOnStart: true, + }); + + sessionSubscribe(session); + } else { + page.on("request", (request) => { + if (/\/ws\//.test(request.url())) { + webSocketRequests.push({ url: request.url() }); + } + }); + } + + await page.goto(`https://${hostname}:${port1}/`, { + waitUntil: "networkidle0", + }); + + const webSocketRequest = webSocketRequests[0]; + + if (webSocketServer === "ws") { + expect(webSocketRequest.url).toContain( + `wss://${hostname}:${port1}/ws`, + ); + } else { + expect(webSocketRequest.url).toContain( + `https://${hostname}:${port1}/ws`, + ); + } + + expect(consoleMessages.map((message) => message.text())).toEqual([ + "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", + "[HMR] Waiting for update signal from WDS...", + "Hey.", + ]); + expect(pageErrors).toHaveLength(0); + } catch (error) { + throw error; + } finally { + await browser.close(); + await server.stop(); } - - await page.goto(`https://${hostname}:${port1}/`, { - waitUntil: "networkidle0", - }); - - const webSocketRequest = webSocketRequests[0]; - - if (webSocketServer === "ws") { - expect(webSocketRequest.url).toContain( - `wss://${hostname}:${port1}/ws`, - ); - } else { - expect(webSocketRequest.url).toContain( - `https://${hostname}:${port1}/ws`, - ); - } - - expect( - consoleMessages.map((message) => message.text()), - ).toMatchSnapshot("console messages"); - expect(pageErrors).toMatchSnapshot("page errors"); - } catch (error) { - throw error; - } finally { - await browser.close(); - await server.stop(); - } - }); + }, + ); it(`should work when "port" option is "auto" ("${webSocketServer}")`, async () => { process.env.WEBPACK_DEV_SERVER_BASE_PORT = 50000;