Skip to content

Commit 2adfd01

Browse files
test: fix todo (#3653)
1 parent 6e2cbde commit 2adfd01

3 files changed

+93
-2
lines changed

test/e2e/__snapshots__/web-socket-communication.test.js.snap.webpack4

+46
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,52 @@ Array [
2424

2525
exports[`web socket communication should work and close web socket client connection when web socket server closed ("ws"): page errors 1`] = `Array []`;
2626

27+
exports[`web socket communication should work and reconnect when the connection is lost ("sockjs"): console messages 1`] = `
28+
Array [
29+
"[HMR] Waiting for update signal from WDS...",
30+
"Hey.",
31+
"[webpack-dev-server] Hot Module Replacement enabled.",
32+
"[webpack-dev-server] Live Reloading enabled.",
33+
"[webpack-dev-server] Disconnected!",
34+
"[webpack-dev-server] Hot Module Replacement enabled.",
35+
"[webpack-dev-server] Live Reloading enabled.",
36+
"[webpack-dev-server] App hot update...",
37+
"[HMR] Checking for updates on the server...",
38+
"Failed to load resource: the server responded with a status of 404 (Not Found)",
39+
"[HMR] Cannot find update. Need to do a full reload!",
40+
"[HMR] (Probably because of restarting the webpack-dev-server)",
41+
"[HMR] Waiting for update signal from WDS...",
42+
"Hey.",
43+
"[webpack-dev-server] Hot Module Replacement enabled.",
44+
"[webpack-dev-server] Live Reloading enabled.",
45+
]
46+
`;
47+
48+
exports[`web socket communication should work and reconnect when the connection is lost ("sockjs"): page errors 1`] = `Array []`;
49+
50+
exports[`web socket communication should work and reconnect when the connection is lost ("ws"): console messages 1`] = `
51+
Array [
52+
"[HMR] Waiting for update signal from WDS...",
53+
"Hey.",
54+
"[webpack-dev-server] Hot Module Replacement enabled.",
55+
"[webpack-dev-server] Live Reloading enabled.",
56+
"[webpack-dev-server] Disconnected!",
57+
"[webpack-dev-server] Hot Module Replacement enabled.",
58+
"[webpack-dev-server] Live Reloading enabled.",
59+
"[webpack-dev-server] App hot update...",
60+
"[HMR] Checking for updates on the server...",
61+
"Failed to load resource: the server responded with a status of 404 (Not Found)",
62+
"[HMR] Cannot find update. Need to do a full reload!",
63+
"[HMR] (Probably because of restarting the webpack-dev-server)",
64+
"[HMR] Waiting for update signal from WDS...",
65+
"Hey.",
66+
"[webpack-dev-server] Hot Module Replacement enabled.",
67+
"[webpack-dev-server] Live Reloading enabled.",
68+
]
69+
`;
70+
71+
exports[`web socket communication should work and reconnect when the connection is lost ("ws"): page errors 1`] = `Array []`;
72+
2773
exports[`web socket communication should work and terminate client that is not alive ("sockjs"): console messages 1`] = `
2874
Array [
2975
"[HMR] Waiting for update signal from WDS...",

test/e2e/__snapshots__/web-socket-communication.test.js.snap.webpack5

+46
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,52 @@ Array [
2424

2525
exports[`web socket communication should work and close web socket client connection when web socket server closed ("ws"): page errors 1`] = `Array []`;
2626

27+
exports[`web socket communication should work and reconnect when the connection is lost ("sockjs"): console messages 1`] = `
28+
Array [
29+
"[HMR] Waiting for update signal from WDS...",
30+
"Hey.",
31+
"[webpack-dev-server] Hot Module Replacement enabled.",
32+
"[webpack-dev-server] Live Reloading enabled.",
33+
"[webpack-dev-server] Disconnected!",
34+
"[webpack-dev-server] Hot Module Replacement enabled.",
35+
"[webpack-dev-server] Live Reloading enabled.",
36+
"[webpack-dev-server] App hot update...",
37+
"[HMR] Checking for updates on the server...",
38+
"Failed to load resource: the server responded with a status of 404 (Not Found)",
39+
"[HMR] Cannot find update. Need to do a full reload!",
40+
"[HMR] (Probably because of restarting the webpack-dev-server)",
41+
"[HMR] Waiting for update signal from WDS...",
42+
"Hey.",
43+
"[webpack-dev-server] Hot Module Replacement enabled.",
44+
"[webpack-dev-server] Live Reloading enabled.",
45+
]
46+
`;
47+
48+
exports[`web socket communication should work and reconnect when the connection is lost ("sockjs"): page errors 1`] = `Array []`;
49+
50+
exports[`web socket communication should work and reconnect when the connection is lost ("ws"): console messages 1`] = `
51+
Array [
52+
"[HMR] Waiting for update signal from WDS...",
53+
"Hey.",
54+
"[webpack-dev-server] Hot Module Replacement enabled.",
55+
"[webpack-dev-server] Live Reloading enabled.",
56+
"[webpack-dev-server] Disconnected!",
57+
"[webpack-dev-server] Hot Module Replacement enabled.",
58+
"[webpack-dev-server] Live Reloading enabled.",
59+
"[webpack-dev-server] App hot update...",
60+
"[HMR] Checking for updates on the server...",
61+
"Failed to load resource: the server responded with a status of 404 (Not Found)",
62+
"[HMR] Cannot find update. Need to do a full reload!",
63+
"[HMR] (Probably because of restarting the webpack-dev-server)",
64+
"[HMR] Waiting for update signal from WDS...",
65+
"Hey.",
66+
"[webpack-dev-server] Hot Module Replacement enabled.",
67+
"[webpack-dev-server] Live Reloading enabled.",
68+
]
69+
`;
70+
71+
exports[`web socket communication should work and reconnect when the connection is lost ("ws"): page errors 1`] = `Array []`;
72+
2773
exports[`web socket communication should work and terminate client that is not alive ("sockjs"): console messages 1`] = `
2874
Array [
2975
"[HMR] Waiting for update signal from WDS...",

test/e2e/web-socket-communication.test.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ describe("web socket communication", () => {
109109
await server.stop();
110110
});
111111

112-
// TODO uncomment after fix regression in webpack
113-
it.skip(`should work and reconnect when the connection is lost ("${websocketServer}")`, async () => {
112+
it(`should work and reconnect when the connection is lost ("${websocketServer}")`, async () => {
114113
WebsocketServer.heartbeatInterval = 100;
115114

116115
const compiler = webpack(config);

0 commit comments

Comments
 (0)