Skip to content

Commit

Permalink
test: move test case to appropriate place (#3871)
Browse files Browse the repository at this point in the history
* chore: remove duplicate test case

* test: move test case to appropriate place
  • Loading branch information
snitin315 authored Sep 24, 2021
1 parent 19b3678 commit 4962424
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 20 deletions.
20 changes: 0 additions & 20 deletions test/server/client-option.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,26 +105,6 @@ describe("client option", () => {

await server.stop();
});

it("disables hot entry", async () => {
const compiler = webpack(config);

server = new Server(
{
hot: false,
port,
},
compiler
);

await server.start();

const res = await request(server.app).get("/main.js");

expect(res.text).not.toMatch(/webpack\/hot\/dev-server\.js/);

await server.stop();
});
});

describe("webSocketTransport", () => {
Expand Down
29 changes: 29 additions & 0 deletions test/server/hot-option.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,35 @@ describe("hot option", () => {
});
});

describe("simple config with hot: false", () => {
beforeAll(async () => {
const compiler = webpack(config);

server = new Server(
{
port,
hot: false,
},
compiler
);

await server.start();

req = request(server.app);
});

afterAll(async () => {
await server.stop();
});

it("should not include hot script in the bundle", async () => {
const response = await req.get("/main.js");

expect(response.status).toEqual(200);
expect(response.text).not.toContain("webpack/hot/dev-server.js");
});
});

describe("simple hot-only config entries", () => {
beforeAll(async () => {
const compiler = webpack(config);
Expand Down

0 comments on commit 4962424

Please sign in to comment.