Skip to content

Commit 0aca07b

Browse files
authored
test: migrate hot and liveReload tests on HTMLGeneratorPlugin. (#4195)
1 parent 6e9ff97 commit 0aca07b

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

test/e2e/hot-and-live-reload.test.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const SockJS = require("sockjs-client");
1010
const webpack = require("webpack");
1111
const fs = require("graceful-fs");
1212
const Server = require("../../lib/Server");
13+
const HTMLGeneratorPlugin = require("../helpers/html-generator-plugin");
1314
const reloadConfig = require("../fixtures/reload-config/webpack.config");
1415
const runBrowser = require("../helpers/run-browser");
1516
const port = require("../ports-map")["hot-and-live-reload"];
@@ -248,7 +249,10 @@ describe("hot and live reload", () => {
248249
`${require.resolve("../../client-src/index.js")}?hot=true`,
249250
require.resolve("../fixtures/reload-config/foo.js"),
250251
],
251-
plugins: [new webpack.HotModuleReplacementPlugin()],
252+
plugins: [
253+
new webpack.HotModuleReplacementPlugin(),
254+
new HTMLGeneratorPlugin(),
255+
],
252256
},
253257
options: {
254258
client: false,
@@ -461,7 +465,7 @@ describe("hot and live reload", () => {
461465
}
462466
});
463467

464-
await page.goto(`http://localhost:${port}/main${mode.query || ""}`, {
468+
await page.goto(`http://localhost:${port}/${mode.query || ""}`, {
465469
waitUntil: "networkidle0",
466470
});
467471

@@ -620,7 +624,7 @@ describe("simple hot config HMR plugin", () => {
620624
pageErrors.push(error);
621625
});
622626

623-
const response = await page.goto(`http://127.0.0.1:${port}/main`, {
627+
const response = await page.goto(`http://127.0.0.1:${port}/`, {
624628
waitUntil: "networkidle0",
625629
});
626630

@@ -687,7 +691,7 @@ describe("simple hot config HMR plugin with already added HMR plugin", () => {
687691
pageErrors.push(error);
688692
});
689693

690-
const response = await page.goto(`http://127.0.0.1:${port}/main`, {
694+
const response = await page.goto(`http://127.0.0.1:${port}/`, {
691695
waitUntil: "networkidle0",
692696
});
693697

@@ -818,7 +822,7 @@ describe("multi compiler hot config HMR plugin", () => {
818822
pageErrors.push(error);
819823
});
820824

821-
const response = await page.goto(`http://127.0.0.1:${port}/main`, {
825+
const response = await page.goto(`http://127.0.0.1:${port}/`, {
822826
waitUntil: "networkidle0",
823827
});
824828

@@ -881,7 +885,7 @@ describe("hot disabled HMR plugin", () => {
881885
pageErrors.push(error);
882886
});
883887

884-
const response = await page.goto(`http://127.0.0.1:${port}/main`, {
888+
const response = await page.goto(`http://127.0.0.1:${port}/`, {
885889
waitUntil: "networkidle0",
886890
});
887891

test/fixtures/reload-config/webpack.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"use strict";
22

33
const webpack = require("webpack");
4+
const HTMLGeneratorPlugin = require("../../helpers/html-generator-plugin");
45

56
const isWebpack5 = webpack.version.startsWith("5");
67

@@ -30,4 +31,5 @@ module.exports = {
3031
: {
3132
level: "info",
3233
},
34+
plugins: [new HTMLGeneratorPlugin()],
3335
};

0 commit comments

Comments
 (0)