Skip to content

Commit 4962424

Browse files
authored
test: move test case to appropriate place (#3871)
* chore: remove duplicate test case * test: move test case to appropriate place
1 parent 19b3678 commit 4962424

File tree

2 files changed

+29
-20
lines changed

2 files changed

+29
-20
lines changed

test/server/client-option.test.js

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -105,26 +105,6 @@ describe("client option", () => {
105105

106106
await server.stop();
107107
});
108-
109-
it("disables hot entry", async () => {
110-
const compiler = webpack(config);
111-
112-
server = new Server(
113-
{
114-
hot: false,
115-
port,
116-
},
117-
compiler
118-
);
119-
120-
await server.start();
121-
122-
const res = await request(server.app).get("/main.js");
123-
124-
expect(res.text).not.toMatch(/webpack\/hot\/dev-server\.js/);
125-
126-
await server.stop();
127-
});
128108
});
129109

130110
describe("webSocketTransport", () => {

test/server/hot-option.test.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,35 @@ describe("hot option", () => {
3434
});
3535
});
3636

37+
describe("simple config with hot: false", () => {
38+
beforeAll(async () => {
39+
const compiler = webpack(config);
40+
41+
server = new Server(
42+
{
43+
port,
44+
hot: false,
45+
},
46+
compiler
47+
);
48+
49+
await server.start();
50+
51+
req = request(server.app);
52+
});
53+
54+
afterAll(async () => {
55+
await server.stop();
56+
});
57+
58+
it("should not include hot script in the bundle", async () => {
59+
const response = await req.get("/main.js");
60+
61+
expect(response.status).toEqual(200);
62+
expect(response.text).not.toContain("webpack/hot/dev-server.js");
63+
});
64+
});
65+
3766
describe("simple hot-only config entries", () => {
3867
beforeAll(async () => {
3968
const compiler = webpack(config);

0 commit comments

Comments
 (0)