Skip to content

Commit

Permalink
test: add e2e test for universal compiler (#3656)
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Aug 17, 2021
1 parent f94b84f commit ae8c523
Show file tree
Hide file tree
Showing 15 changed files with 122 additions and 92 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Universal compiler client bundle should have the inlined the client runtime: console messages 1`] = `Array []`;

exports[`Universal compiler client bundle should have the inlined the client runtime: page errors 1`] = `Array []`;

exports[`Universal compiler server bundle should NOT have the inlined the client runtime: console messages 1`] = `Array []`;

exports[`Universal compiler server bundle should NOT have the inlined the client runtime: page errors 1`] = `Array []`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Universal compiler client bundle should have the inlined the client runtime: console messages 1`] = `Array []`;

exports[`Universal compiler client bundle should have the inlined the client runtime: page errors 1`] = `Array []`;

exports[`Universal compiler server bundle should NOT have the inlined the client runtime: console messages 1`] = `Array []`;

exports[`Universal compiler server bundle should NOT have the inlined the client runtime: page errors 1`] = `Array []`;
6 changes: 3 additions & 3 deletions test/e2e/api.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const port = require("../ports-map").api;
describe("API", () => {
it(`should work with async API`, async () => {
const compiler = webpack(config);
const server = new Server({ host: "127.0.0.1", port }, compiler);
const server = new Server({ port }, compiler);

await server.start();

Expand Down Expand Up @@ -41,7 +41,7 @@ describe("API", () => {

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

await new Promise((resolve) => {
server.startCallback(() => {
Expand Down Expand Up @@ -81,7 +81,7 @@ describe("API", () => {

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

await new Promise((resolve, reject) => {
Expand Down
9 changes: 0 additions & 9 deletions test/e2e/entry.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ describe("entry", () => {
it("should work with single entry", async () => {
const compiler = webpack({ ...config, entry: entryFirst });
const devServerOptions = {
host: "127.0.0.1",
port,
};
const server = new Server(devServerOptions, compiler);
Expand Down Expand Up @@ -79,7 +78,6 @@ describe("entry", () => {
it("should work with single array entry", async () => {
const compiler = webpack({ ...config, entry: [entryFirst, entrySecond] });
const devServerOptions = {
host: "127.0.0.1",
port,
};
const server = new Server(devServerOptions, compiler);
Expand Down Expand Up @@ -120,7 +118,6 @@ describe("entry", () => {
},
});
const devServerOptions = {
host: "127.0.0.1",
port,
};
const server = new Server(devServerOptions, compiler);
Expand Down Expand Up @@ -156,7 +153,6 @@ describe("entry", () => {
it("should work with dynamic entry", async () => {
const compiler = webpack({ ...config, entry: () => entryFirst });
const devServerOptions = {
host: "127.0.0.1",
port,
};
const server = new Server(devServerOptions, compiler);
Expand Down Expand Up @@ -195,7 +191,6 @@ describe("entry", () => {
entry: () => new Promise((resolve) => resolve([entryFirst])),
});
const devServerOptions = {
host: "127.0.0.1",
port,
};
const server = new Server(devServerOptions, compiler);
Expand Down Expand Up @@ -242,7 +237,6 @@ describe("entry", () => {
},
});
const devServerOptions = {
host: "127.0.0.1",
port,
};
const server = new Server(devServerOptions, compiler);
Expand Down Expand Up @@ -290,7 +284,6 @@ describe("entry", () => {
},
});
const devServerOptions = {
host: "127.0.0.1",
port,
};
const server = new Server(devServerOptions, compiler);
Expand Down Expand Up @@ -337,7 +330,6 @@ describe("entry", () => {
},
});
const devServerOptions = {
host: "127.0.0.1",
port,
};
const server = new Server(devServerOptions, compiler);
Expand Down Expand Up @@ -384,7 +376,6 @@ describe("entry", () => {
}).apply(compiler);

const devServerOptions = {
host: "127.0.0.1",
port,
};
const server = new Server(devServerOptions, compiler);
Expand Down
1 change: 0 additions & 1 deletion test/e2e/hot-and-live-reload.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ describe("hot and live reload", () => {
const compiler = webpack(webpackOptions);
const testDevServerOptions = mode.options || {};
const devServerOptions = {
host: "0.0.0.0",
port,
...testDevServerOptions,
};
Expand Down
2 changes: 0 additions & 2 deletions test/e2e/ipc.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ describe("web socket server URL", () => {
const compiler = webpack(config);
const devServerOptions = {
webSocketServer,
host: devServerHost,
ipc: true,
};
const server = new Server(devServerOptions, compiler);
Expand Down Expand Up @@ -118,7 +117,6 @@ describe("web socket server URL", () => {
const compiler = webpack(config);
const devServerOptions = {
webSocketServer,
host: devServerHost,
ipc,
};
const server = new Server(devServerOptions, compiler);
Expand Down
1 change: 0 additions & 1 deletion test/e2e/logging.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ describe("logging", () => {
})`, async () => {
const compiler = webpack({ ...config, ...testCase.webpackOptions });
const devServerOptions = {
host: "0.0.0.0",
port,
...testCase.devServerOptions,
};
Expand Down
1 change: 0 additions & 1 deletion test/e2e/multi-compiler.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ describe("Multi compiler", () => {
it(`should work with multiple compilers`, async () => {
const compiler = webpack(config);
const devServerOptions = {
host: "127.0.0.1",
port,
};
const server = new Server(devServerOptions, compiler);
Expand Down
18 changes: 0 additions & 18 deletions test/e2e/overlay.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ describe("overlay", () => {
new WarningPlugin().apply(compiler);

const devServerOptions = {
host: "0.0.0.0",
port,
};
const server = new Server(devServerOptions, compiler);
Expand Down Expand Up @@ -86,7 +85,6 @@ describe("overlay", () => {
new ErrorPlugin().apply(compiler);

const devServerOptions = {
host: "0.0.0.0",
port,
};
const server = new Server(devServerOptions, compiler);
Expand Down Expand Up @@ -127,7 +125,6 @@ describe("overlay", () => {
new ErrorPlugin().apply(compiler);

const devServerOptions = {
host: "0.0.0.0",
port,
};
const server = new Server(devServerOptions, compiler);
Expand Down Expand Up @@ -166,7 +163,6 @@ describe("overlay", () => {
);

const devServerOptions = {
host: "0.0.0.0",
port,
};
const server = new Server(devServerOptions, compiler);
Expand Down Expand Up @@ -204,7 +200,6 @@ describe("overlay", () => {
new ErrorPlugin("<strong>strong</strong>").apply(compiler);

const devServerOptions = {
host: "0.0.0.0",
port,
};
const server = new Server(devServerOptions, compiler);
Expand Down Expand Up @@ -238,7 +233,6 @@ describe("overlay", () => {
it("should not show initially, then show on an error, then hide on fix", async () => {
const compiler = webpack(config);
const devServerOptions = {
host: "0.0.0.0",
port,
};
const server = new Server(devServerOptions, compiler);
Expand Down Expand Up @@ -305,7 +299,6 @@ describe("overlay", () => {
it("should not show initially, then show on an error, then show other error, then hide on fix", async () => {
const compiler = webpack(config);
const devServerOptions = {
host: "0.0.0.0",
port,
};
const server = new Server(devServerOptions, compiler);
Expand Down Expand Up @@ -392,7 +385,6 @@ describe("overlay", () => {
it("should not show initially, then show on an error and allow to close", async () => {
const compiler = webpack(config);
const devServerOptions = {
host: "0.0.0.0",
port,
};
const server = new Server(devServerOptions, compiler);
Expand Down Expand Up @@ -470,7 +462,6 @@ describe("overlay", () => {
new WarningPlugin().apply(compiler);

const devServerOptions = {
host: "0.0.0.0",
port,
client: {
overlay: false,
Expand Down Expand Up @@ -504,7 +495,6 @@ describe("overlay", () => {
new WarningPlugin().apply(compiler);

const devServerOptions = {
host: "0.0.0.0",
port,
client: {
overlay: {
Expand Down Expand Up @@ -540,7 +530,6 @@ describe("overlay", () => {
new WarningPlugin().apply(compiler);

const devServerOptions = {
host: "0.0.0.0",
port,
client: {
overlay: true,
Expand Down Expand Up @@ -580,7 +569,6 @@ describe("overlay", () => {
new WarningPlugin().apply(compiler);

const devServerOptions = {
host: "0.0.0.0",
port,
client: {
overlay: {
Expand Down Expand Up @@ -622,7 +610,6 @@ describe("overlay", () => {
new WarningPlugin().apply(compiler);

const devServerOptions = {
host: "0.0.0.0",
port,
client: {
overlay: {
Expand Down Expand Up @@ -664,7 +651,6 @@ describe("overlay", () => {
new ErrorPlugin().apply(compiler);

const devServerOptions = {
host: "0.0.0.0",
port,
client: {
overlay: false,
Expand Down Expand Up @@ -698,7 +684,6 @@ describe("overlay", () => {
new ErrorPlugin().apply(compiler);

const devServerOptions = {
host: "0.0.0.0",
port,
client: {
overlay: {
Expand Down Expand Up @@ -734,7 +719,6 @@ describe("overlay", () => {
new ErrorPlugin().apply(compiler);

const devServerOptions = {
host: "0.0.0.0",
port,
client: {
overlay: true,
Expand Down Expand Up @@ -774,7 +758,6 @@ describe("overlay", () => {
new ErrorPlugin().apply(compiler);

const devServerOptions = {
host: "0.0.0.0",
port,
client: {
overlay: {
Expand Down Expand Up @@ -816,7 +799,6 @@ describe("overlay", () => {
new WarningPlugin().apply(compiler);

const devServerOptions = {
host: "0.0.0.0",
port,
client: {
overlay: {
Expand Down
1 change: 0 additions & 1 deletion test/e2e/progress.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ describe("progress", () => {
const compiler = webpack(reloadConfig);
const devServerOptions = {
port,
host: "0.0.0.0",
static: false,
hot: true,
client: {
Expand Down
1 change: 0 additions & 1 deletion test/e2e/stats.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ describe("stats", () => {
it(testCase.title, async () => {
const compiler = webpack({ ...config, ...testCase.webpackOptions });
const devServerOptions = {
host: "127.0.0.1",
port,
};
const server = new Server(devServerOptions, compiler);
Expand Down
1 change: 0 additions & 1 deletion test/e2e/target.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ describe("target", () => {
: {}),
});
const devServerOptions = {
host: "127.0.0.1",
port,
};
const server = new Server(devServerOptions, compiler);
Expand Down
Loading

0 comments on commit ae8c523

Please sign in to comment.