Skip to content

Commit fc53905

Browse files
committed
test: update lazy-compilation test
1 parent 210ff8a commit fc53905

8 files changed

+13
-14
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
["[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.","[HMR] Waiting for update signal from WDS...","[webpack-dev-server] App updated. Recompiling...","[webpack-dev-server] App hot update...","[HMR] Checking for updates on the server...","[HMR] Updated modules:","[HMR] - lazy-compilation-proxy","[HMR] - ./one.js!lazy-compilation-proxy","undefined","[HMR] App is up to date.","One.","[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.","[HMR] Waiting for update signal from WDS...","[webpack-dev-server] App updated. Recompiling...","[webpack-dev-server] App hot update...","[HMR] Checking for updates on the server...","[HMR] Updated modules:","[HMR] - lazy-compilation-proxy","[HMR] - ./two.js!lazy-compilation-proxy","undefined","[HMR] App is up to date.","Two."]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
["[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.","[HMR] Waiting for update signal from WDS...","[webpack-dev-server] App updated. Recompiling...","[webpack-dev-server] App hot update...","[HMR] Checking for updates on the server...","[HMR] Updated modules:","[HMR] - lazy-compilation-proxy","[HMR] - ./entry.js!lazy-compilation-proxy","undefined","[HMR] App is up to date.","Hey."]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]

Diff for: test/e2e/ipc.test.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@ const port1 = require("../ports-map").ipc;
1515

1616
const webSocketServers = ["ws", "sockjs"];
1717

18-
test.describe("web socket server URL", {
19-
annotation: {
20-
type: "flaky",
21-
description: "https://github.com/webpack/webpack-dev-server/actions/runs/9957190252/job/27508685202"
22-
}}, () => {
18+
test.describe("web socket server URL", () => {
2319
for (const webSocketServer of webSocketServers) {
2420
const websocketURLProtocol = webSocketServer === "ws" ? "ws" : "http";
2521

Diff for: test/e2e/lazy-compilation.test.js

+6-9
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ const lazyCompilationMultipleEntriesConfig = require("../fixtures/lazy-compilati
99
const port = require("../ports-map")["lazy-compilation"];
1010

1111
describe("lazy compilation", () => {
12-
// TODO jest freeze due webpack do not close `eventsource`, we should uncomment this after fix it on webpack side
13-
test.skip(`should work with single entry`, async ({ page }) => {
12+
test(`should work with single entry`, async ({ page }) => {
1413
const compiler = webpack(lazyCompilationSingleEntryConfig);
1514
const server = new Server({ port }, compiler);
1615

@@ -41,16 +40,16 @@ describe("lazy compilation", () => {
4140
}, 100);
4241
});
4342

44-
expect(consoleMessages).toMatchSnapshotWithArray();
45-
expect(pageErrors).toMatchSnapshotWithArray();
43+
expect(consoleMessages).toMatchSnapshotWithArray("console messages");
44+
expect(pageErrors).toMatchSnapshotWithArray("page errors");
4645
} catch (error) {
4746
throw error;
4847
} finally {
4948
await server.stop();
5049
}
5150
});
5251

53-
test.skip(`should work with multiple entries`, async ({ page }) => {
52+
test(`should work with multiple entries`, async ({ page }) => {
5453
const compiler = webpack(lazyCompilationMultipleEntriesConfig);
5554
const server = new Server({ port }, compiler);
5655

@@ -73,7 +72,6 @@ describe("lazy compilation", () => {
7372
});
7473
await new Promise((resolve) => {
7574
const interval = setInterval(() => {
76-
console.log(consoleMessages);
7775
if (consoleMessages.includes("One.")) {
7876
clearInterval(interval);
7977

@@ -87,7 +85,6 @@ describe("lazy compilation", () => {
8785
});
8886
await new Promise((resolve) => {
8987
const interval = setInterval(() => {
90-
console.log(consoleMessages);
9188
if (consoleMessages.includes("Two.")) {
9289
clearInterval(interval);
9390

@@ -96,8 +93,8 @@ describe("lazy compilation", () => {
9693
}, 100);
9794
});
9895

99-
expect(consoleMessages).toMatchSnapshotWithArray();
100-
expect(pageErrors).toMatchSnapshotWithArray();
96+
expect(consoleMessages).toMatchSnapshotWithArray("console messages");
97+
expect(pageErrors).toMatchSnapshotWithArray("page errors");
10198
} catch (error) {
10299
throw error;
103100
} finally {

0 commit comments

Comments
 (0)