Skip to content

Commit c2dd24b

Browse files
committed
fixup!
1 parent 78d3f88 commit c2dd24b

5 files changed

Lines changed: 24 additions & 26 deletions

File tree

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/e2e/__snapshots__/api.test.js.snap.webpack5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ exports[`API > Invalidate callback > should use the provided \`callback\` functi
3131
`;
3232

3333
exports[`API > Server.checkHostHeader > should allow URLs with scheme for checking origin when the "option.client.webSocketURL" is object 1`] = `
34-
"ws://test.host:8156/ws"
34+
"ws://test.host:8157/ws"
3535
`;
3636

3737
exports[`API > Server.checkHostHeader > should allow URLs with scheme for checking origin when the "option.client.webSocketURL" is object 2`] = `
@@ -43,7 +43,7 @@ exports[`API > Server.checkHostHeader > should allow URLs with scheme for checki
4343
"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.",
4444
"[HMR] Waiting for update signal from WDS...",
4545
"Hey.",
46-
"WebSocket connection to 'ws://test.host:8156/ws' failed: Error in connection establishment: net::ERR_NAME_NOT_RESOLVED",
46+
"WebSocket connection to 'ws://test.host:8157/ws' failed: Error in connection establishment: net::ERR_NAME_NOT_RESOLVED",
4747
"[webpack-dev-server] JSHandle@object",
4848
"[webpack-dev-server] Disconnected!",
4949
"[webpack-dev-server] Trying to reconnect...",

test/e2e/__snapshots__/client-reconnect.test.js.snap.webpack5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ exports[`client.reconnect option > specified as number > should try to reconnect
2626
"Hey.",
2727
"[webpack-dev-server] Disconnected!",
2828
"[webpack-dev-server] Trying to reconnect...",
29-
"WebSocket connection to 'ws://localhost:8161/ws' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED",
29+
"WebSocket connection to 'ws://localhost:8162/ws' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED",
3030
"[webpack-dev-server] JSHandle@object",
3131
"[webpack-dev-server] Trying to reconnect...",
32-
"WebSocket connection to 'ws://localhost:8161/ws' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED",
32+
"WebSocket connection to 'ws://localhost:8162/ws' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED",
3333
"[webpack-dev-server] JSHandle@object",
3434
]
3535
`;

test/e2e/__snapshots__/port.test.js.snap.webpack5

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,27 @@ exports[`port > should work using "0" port 2`] = `
1010
[]
1111
`;
1212

13-
exports[`port > should work using "8159" port 1`] = `
13+
exports[`port > should work using "8160" port 1`] = `
1414
[
1515
"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.",
1616
"[HMR] Waiting for update signal from WDS...",
1717
"Hey.",
1818
]
1919
`;
2020

21-
exports[`port > should work using "8159" port 2`] = `
21+
exports[`port > should work using "8160" port 2`] = `
2222
[]
2323
`;
2424

25-
exports[`port > should work using "8159" port 3`] = `
25+
exports[`port > should work using "8160" port 3`] = `
2626
[
2727
"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.",
2828
"[HMR] Waiting for update signal from WDS...",
2929
"Hey.",
3030
]
3131
`;
3232

33-
exports[`port > should work using "8159" port 4`] = `
33+
exports[`port > should work using "8160" port 4`] = `
3434
[]
3535
`;
3636

test/server/proxy-option.test.js

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ describe("proxy option", () => {
618618

619619
const BACKEND_MESSAGE_TYPE = "backend-message";
620620

621-
beforeAll(async () => {
621+
before(async () => {
622622
backendUpgradeCount = 0;
623623

624624
backend = http.createServer();
@@ -654,7 +654,7 @@ describe("proxy option", () => {
654654
await server.start();
655655
});
656656

657-
afterAll(async () => {
657+
after(async () => {
658658
for (const client of backendWss.clients) {
659659
client.terminate();
660660
}
@@ -716,10 +716,8 @@ describe("proxy option", () => {
716716
let backend;
717717
let stderrSpy;
718718

719-
beforeAll(async () => {
720-
stderrSpy = jest
721-
.spyOn(process.stderr, "write")
722-
.mockImplementation(() => true);
719+
before(async () => {
720+
stderrSpy = spyOn(process.stderr, "write").mockImplementation(() => true);
723721

724722
backend = http.createServer();
725723
backend.on("upgrade", (req, socket) => {
@@ -751,7 +749,7 @@ describe("proxy option", () => {
751749
await server.start();
752750
});
753751

754-
afterAll(async () => {
752+
after(async () => {
755753
stderrSpy.mockRestore();
756754
backend.closeAllConnections();
757755
await server.stop();
@@ -910,9 +908,9 @@ describe("proxy option", () => {
910908

911909
for (const { type, hmrPath, nonHmrPath } of serverTypes) {
912910
describe(`with webSocketServerType: ${type}`, () => {
913-
beforeAll(() => setup({ webSocketServer: type }));
911+
before(() => setup({ webSocketServer: type }));
914912

915-
afterAll(teardown);
913+
after(teardown);
916914

917915
it("serves the HMR upgrade locally and does not forward it to the proxy", async () => {
918916
const { opened, forwarded } = await probe(hmrPath);
@@ -933,9 +931,9 @@ describe("proxy option", () => {
933931
// `WebSocketServer#shouldHandle` does, so only the configured path (query
934932
// stripped) is the HMR socket; every other variant is forwarded.
935933
describe("with the `ws` server, path matching is exact", () => {
936-
beforeAll(() => setup({ webSocketServer: "ws" }));
934+
before(() => setup({ webSocketServer: "ws" }));
937935

938-
afterAll(teardown);
936+
after(teardown);
939937

940938
it.each([
941939
["exact path", "/ws"],
@@ -962,13 +960,13 @@ describe("proxy option", () => {
962960
// The HMR path is read from the configured `webSocketServer` options, not a
963961
// hardcoded `/ws`.
964962
describe("with a custom `ws` path", () => {
965-
beforeAll(() =>
963+
before(() =>
966964
setup({
967965
webSocketServer: { type: "ws", options: { path: "/custom-hmr" } },
968966
}),
969967
);
970968

971-
afterAll(teardown);
969+
after(teardown);
972970

973971
it("treats the configured path (/custom-hmr) as the HMR upgrade path", async () => {
974972
const { forwarded } = await probe("/custom-hmr");
@@ -986,11 +984,11 @@ describe("proxy option", () => {
986984
// With no HMR server there is no socket to protect, so the filter never
987985
// engages and even `/ws` is forwarded to the user proxy.
988986
describe("without a webSocketServer", () => {
989-
beforeAll(() =>
987+
before(() =>
990988
setup({ hot: false, liveReload: false, webSocketServer: false }),
991989
);
992990

993-
afterAll(teardown);
991+
after(teardown);
994992

995993
it("forwards /ws to the user proxy because there is no HMR socket to protect", async () => {
996994
const { forwarded } = await probe("/ws");

0 commit comments

Comments
 (0)