Skip to content

Commit ae8c523

Browse files
authored
test: add e2e test for universal compiler (#3656)
1 parent f94b84f commit ae8c523

15 files changed

+122
-92
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`Universal compiler client bundle should have the inlined the client runtime: console messages 1`] = `Array []`;
4+
5+
exports[`Universal compiler client bundle should have the inlined the client runtime: page errors 1`] = `Array []`;
6+
7+
exports[`Universal compiler server bundle should NOT have the inlined the client runtime: console messages 1`] = `Array []`;
8+
9+
exports[`Universal compiler server bundle should NOT have the inlined the client runtime: page errors 1`] = `Array []`;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`Universal compiler client bundle should have the inlined the client runtime: console messages 1`] = `Array []`;
4+
5+
exports[`Universal compiler client bundle should have the inlined the client runtime: page errors 1`] = `Array []`;
6+
7+
exports[`Universal compiler server bundle should NOT have the inlined the client runtime: console messages 1`] = `Array []`;
8+
9+
exports[`Universal compiler server bundle should NOT have the inlined the client runtime: page errors 1`] = `Array []`;

test/e2e/api.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const port = require("../ports-map").api;
99
describe("API", () => {
1010
it(`should work with async API`, async () => {
1111
const compiler = webpack(config);
12-
const server = new Server({ host: "127.0.0.1", port }, compiler);
12+
const server = new Server({ port }, compiler);
1313

1414
await server.start();
1515

@@ -41,7 +41,7 @@ describe("API", () => {
4141

4242
it(`should work with callback API`, async () => {
4343
const compiler = webpack(config);
44-
const server = new Server({ host: "127.0.0.1", port }, compiler);
44+
const server = new Server({ port }, compiler);
4545

4646
await new Promise((resolve) => {
4747
server.startCallback(() => {
@@ -81,7 +81,7 @@ describe("API", () => {
8181

8282
it(`should work with deprecated API`, async () => {
8383
const compiler = webpack(config);
84-
const devServerOptions = { host: "127.0.0.1", port };
84+
const devServerOptions = { port };
8585
const server = new Server(devServerOptions, compiler);
8686

8787
await new Promise((resolve, reject) => {

test/e2e/entry.test.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ describe("entry", () => {
4343
it("should work with single entry", async () => {
4444
const compiler = webpack({ ...config, entry: entryFirst });
4545
const devServerOptions = {
46-
host: "127.0.0.1",
4746
port,
4847
};
4948
const server = new Server(devServerOptions, compiler);
@@ -79,7 +78,6 @@ describe("entry", () => {
7978
it("should work with single array entry", async () => {
8079
const compiler = webpack({ ...config, entry: [entryFirst, entrySecond] });
8180
const devServerOptions = {
82-
host: "127.0.0.1",
8381
port,
8482
};
8583
const server = new Server(devServerOptions, compiler);
@@ -120,7 +118,6 @@ describe("entry", () => {
120118
},
121119
});
122120
const devServerOptions = {
123-
host: "127.0.0.1",
124121
port,
125122
};
126123
const server = new Server(devServerOptions, compiler);
@@ -156,7 +153,6 @@ describe("entry", () => {
156153
it("should work with dynamic entry", async () => {
157154
const compiler = webpack({ ...config, entry: () => entryFirst });
158155
const devServerOptions = {
159-
host: "127.0.0.1",
160156
port,
161157
};
162158
const server = new Server(devServerOptions, compiler);
@@ -195,7 +191,6 @@ describe("entry", () => {
195191
entry: () => new Promise((resolve) => resolve([entryFirst])),
196192
});
197193
const devServerOptions = {
198-
host: "127.0.0.1",
199194
port,
200195
};
201196
const server = new Server(devServerOptions, compiler);
@@ -242,7 +237,6 @@ describe("entry", () => {
242237
},
243238
});
244239
const devServerOptions = {
245-
host: "127.0.0.1",
246240
port,
247241
};
248242
const server = new Server(devServerOptions, compiler);
@@ -290,7 +284,6 @@ describe("entry", () => {
290284
},
291285
});
292286
const devServerOptions = {
293-
host: "127.0.0.1",
294287
port,
295288
};
296289
const server = new Server(devServerOptions, compiler);
@@ -337,7 +330,6 @@ describe("entry", () => {
337330
},
338331
});
339332
const devServerOptions = {
340-
host: "127.0.0.1",
341333
port,
342334
};
343335
const server = new Server(devServerOptions, compiler);
@@ -384,7 +376,6 @@ describe("entry", () => {
384376
}).apply(compiler);
385377

386378
const devServerOptions = {
387-
host: "127.0.0.1",
388379
port,
389380
};
390381
const server = new Server(devServerOptions, compiler);

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,6 @@ describe("hot and live reload", () => {
286286
const compiler = webpack(webpackOptions);
287287
const testDevServerOptions = mode.options || {};
288288
const devServerOptions = {
289-
host: "0.0.0.0",
290289
port,
291290
...testDevServerOptions,
292291
};

test/e2e/ipc.test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ describe("web socket server URL", () => {
2525
const compiler = webpack(config);
2626
const devServerOptions = {
2727
webSocketServer,
28-
host: devServerHost,
2928
ipc: true,
3029
};
3130
const server = new Server(devServerOptions, compiler);
@@ -118,7 +117,6 @@ describe("web socket server URL", () => {
118117
const compiler = webpack(config);
119118
const devServerOptions = {
120119
webSocketServer,
121-
host: devServerHost,
122120
ipc,
123121
};
124122
const server = new Server(devServerOptions, compiler);

test/e2e/logging.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ describe("logging", () => {
190190
})`, async () => {
191191
const compiler = webpack({ ...config, ...testCase.webpackOptions });
192192
const devServerOptions = {
193-
host: "0.0.0.0",
194193
port,
195194
...testCase.devServerOptions,
196195
};

test/e2e/multi-compiler.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ describe("Multi compiler", () => {
1010
it(`should work with multiple compilers`, async () => {
1111
const compiler = webpack(config);
1212
const devServerOptions = {
13-
host: "127.0.0.1",
1413
port,
1514
};
1615
const server = new Server(devServerOptions, compiler);

test/e2e/overlay.test.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ describe("overlay", () => {
4949
new WarningPlugin().apply(compiler);
5050

5151
const devServerOptions = {
52-
host: "0.0.0.0",
5352
port,
5453
};
5554
const server = new Server(devServerOptions, compiler);
@@ -86,7 +85,6 @@ describe("overlay", () => {
8685
new ErrorPlugin().apply(compiler);
8786

8887
const devServerOptions = {
89-
host: "0.0.0.0",
9088
port,
9189
};
9290
const server = new Server(devServerOptions, compiler);
@@ -127,7 +125,6 @@ describe("overlay", () => {
127125
new ErrorPlugin().apply(compiler);
128126

129127
const devServerOptions = {
130-
host: "0.0.0.0",
131128
port,
132129
};
133130
const server = new Server(devServerOptions, compiler);
@@ -166,7 +163,6 @@ describe("overlay", () => {
166163
);
167164

168165
const devServerOptions = {
169-
host: "0.0.0.0",
170166
port,
171167
};
172168
const server = new Server(devServerOptions, compiler);
@@ -204,7 +200,6 @@ describe("overlay", () => {
204200
new ErrorPlugin("<strong>strong</strong>").apply(compiler);
205201

206202
const devServerOptions = {
207-
host: "0.0.0.0",
208203
port,
209204
};
210205
const server = new Server(devServerOptions, compiler);
@@ -238,7 +233,6 @@ describe("overlay", () => {
238233
it("should not show initially, then show on an error, then hide on fix", async () => {
239234
const compiler = webpack(config);
240235
const devServerOptions = {
241-
host: "0.0.0.0",
242236
port,
243237
};
244238
const server = new Server(devServerOptions, compiler);
@@ -305,7 +299,6 @@ describe("overlay", () => {
305299
it("should not show initially, then show on an error, then show other error, then hide on fix", async () => {
306300
const compiler = webpack(config);
307301
const devServerOptions = {
308-
host: "0.0.0.0",
309302
port,
310303
};
311304
const server = new Server(devServerOptions, compiler);
@@ -392,7 +385,6 @@ describe("overlay", () => {
392385
it("should not show initially, then show on an error and allow to close", async () => {
393386
const compiler = webpack(config);
394387
const devServerOptions = {
395-
host: "0.0.0.0",
396388
port,
397389
};
398390
const server = new Server(devServerOptions, compiler);
@@ -470,7 +462,6 @@ describe("overlay", () => {
470462
new WarningPlugin().apply(compiler);
471463

472464
const devServerOptions = {
473-
host: "0.0.0.0",
474465
port,
475466
client: {
476467
overlay: false,
@@ -504,7 +495,6 @@ describe("overlay", () => {
504495
new WarningPlugin().apply(compiler);
505496

506497
const devServerOptions = {
507-
host: "0.0.0.0",
508498
port,
509499
client: {
510500
overlay: {
@@ -540,7 +530,6 @@ describe("overlay", () => {
540530
new WarningPlugin().apply(compiler);
541531

542532
const devServerOptions = {
543-
host: "0.0.0.0",
544533
port,
545534
client: {
546535
overlay: true,
@@ -580,7 +569,6 @@ describe("overlay", () => {
580569
new WarningPlugin().apply(compiler);
581570

582571
const devServerOptions = {
583-
host: "0.0.0.0",
584572
port,
585573
client: {
586574
overlay: {
@@ -622,7 +610,6 @@ describe("overlay", () => {
622610
new WarningPlugin().apply(compiler);
623611

624612
const devServerOptions = {
625-
host: "0.0.0.0",
626613
port,
627614
client: {
628615
overlay: {
@@ -664,7 +651,6 @@ describe("overlay", () => {
664651
new ErrorPlugin().apply(compiler);
665652

666653
const devServerOptions = {
667-
host: "0.0.0.0",
668654
port,
669655
client: {
670656
overlay: false,
@@ -698,7 +684,6 @@ describe("overlay", () => {
698684
new ErrorPlugin().apply(compiler);
699685

700686
const devServerOptions = {
701-
host: "0.0.0.0",
702687
port,
703688
client: {
704689
overlay: {
@@ -734,7 +719,6 @@ describe("overlay", () => {
734719
new ErrorPlugin().apply(compiler);
735720

736721
const devServerOptions = {
737-
host: "0.0.0.0",
738722
port,
739723
client: {
740724
overlay: true,
@@ -774,7 +758,6 @@ describe("overlay", () => {
774758
new ErrorPlugin().apply(compiler);
775759

776760
const devServerOptions = {
777-
host: "0.0.0.0",
778761
port,
779762
client: {
780763
overlay: {
@@ -816,7 +799,6 @@ describe("overlay", () => {
816799
new WarningPlugin().apply(compiler);
817800

818801
const devServerOptions = {
819-
host: "0.0.0.0",
820802
port,
821803
client: {
822804
overlay: {

test/e2e/progress.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ describe("progress", () => {
2020
const compiler = webpack(reloadConfig);
2121
const devServerOptions = {
2222
port,
23-
host: "0.0.0.0",
2423
static: false,
2524
hot: true,
2625
client: {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy