Skip to content

Commit e99c0bc

Browse files
authored
test: migrate test case from https to server option for allowedHost option (#4184)
* test: add e2e test case for allowedHost option * test: remove https test case * test: update snapshots
1 parent a24193b commit e99c0bc

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

test/e2e/__snapshots__/allowed-hosts.test.js.snap.webpack4

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ Array [
314314

315315
exports[`allowed hosts should disconnect web socket client using custom hostname from web socket server with the "auto" value based on the "host" header ("ws"): page errors 1`] = `Array []`;
316316

317-
exports[`allowed hosts should disconnect web socket client using custom hostname from web socket server with the "auto" value based on the "host" header when "https" is enabled ("sockjs"): console messages 1`] = `
317+
exports[`allowed hosts should disconnect web socket client using custom hostname from web socket server with the "auto" value based on the "host" header when "server: 'https'" is enabled ("sockjs"): console messages 1`] = `
318318
Array [
319319
"[HMR] Waiting for update signal from WDS...",
320320
"Hey.",
@@ -324,9 +324,9 @@ Array [
324324
]
325325
`;
326326

327-
exports[`allowed hosts should disconnect web socket client using custom hostname from web socket server with the "auto" value based on the "host" header when "https" is enabled ("sockjs"): page errors 1`] = `Array []`;
327+
exports[`allowed hosts should disconnect web socket client using custom hostname from web socket server with the "auto" value based on the "host" header when "server: 'https'" is enabled ("sockjs"): page errors 1`] = `Array []`;
328328

329-
exports[`allowed hosts should disconnect web socket client using custom hostname from web socket server with the "auto" value based on the "host" header when "https" is enabled ("ws"): console messages 1`] = `
329+
exports[`allowed hosts should disconnect web socket client using custom hostname from web socket server with the "auto" value based on the "host" header when "server: 'https'" is enabled ("ws"): console messages 1`] = `
330330
Array [
331331
"[HMR] Waiting for update signal from WDS...",
332332
"Hey.",
@@ -336,7 +336,7 @@ Array [
336336
]
337337
`;
338338

339-
exports[`allowed hosts should disconnect web socket client using custom hostname from web socket server with the "auto" value based on the "host" header when "https" is enabled ("ws"): page errors 1`] = `Array []`;
339+
exports[`allowed hosts should disconnect web socket client using custom hostname from web socket server with the "auto" value based on the "host" header when "server: 'https'" is enabled ("ws"): page errors 1`] = `Array []`;
340340

341341
exports[`allowed hosts should disconnect web socket client using custom hostname from web socket server with the "auto" value based on the "origin" header ("sockjs"): console messages 1`] = `
342342
Array [

test/e2e/__snapshots__/allowed-hosts.test.js.snap.webpack5

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ Array [
314314

315315
exports[`allowed hosts should disconnect web socket client using custom hostname from web socket server with the "auto" value based on the "host" header ("ws"): page errors 1`] = `Array []`;
316316

317-
exports[`allowed hosts should disconnect web socket client using custom hostname from web socket server with the "auto" value based on the "host" header when "https" is enabled ("sockjs"): console messages 1`] = `
317+
exports[`allowed hosts should disconnect web socket client using custom hostname from web socket server with the "auto" value based on the "host" header when "server: 'https'" is enabled ("sockjs"): console messages 1`] = `
318318
Array [
319319
"[HMR] Waiting for update signal from WDS...",
320320
"Hey.",
@@ -324,9 +324,9 @@ Array [
324324
]
325325
`;
326326

327-
exports[`allowed hosts should disconnect web socket client using custom hostname from web socket server with the "auto" value based on the "host" header when "https" is enabled ("sockjs"): page errors 1`] = `Array []`;
327+
exports[`allowed hosts should disconnect web socket client using custom hostname from web socket server with the "auto" value based on the "host" header when "server: 'https'" is enabled ("sockjs"): page errors 1`] = `Array []`;
328328

329-
exports[`allowed hosts should disconnect web socket client using custom hostname from web socket server with the "auto" value based on the "host" header when "https" is enabled ("ws"): console messages 1`] = `
329+
exports[`allowed hosts should disconnect web socket client using custom hostname from web socket server with the "auto" value based on the "host" header when "server: 'https'" is enabled ("ws"): console messages 1`] = `
330330
Array [
331331
"[HMR] Waiting for update signal from WDS...",
332332
"Hey.",
@@ -336,7 +336,7 @@ Array [
336336
]
337337
`;
338338

339-
exports[`allowed hosts should disconnect web socket client using custom hostname from web socket server with the "auto" value based on the "host" header when "https" is enabled ("ws"): page errors 1`] = `Array []`;
339+
exports[`allowed hosts should disconnect web socket client using custom hostname from web socket server with the "auto" value based on the "host" header when "server: 'https'" is enabled ("ws"): page errors 1`] = `Array []`;
340340

341341
exports[`allowed hosts should disconnect web socket client using custom hostname from web socket server with the "auto" value based on the "origin" header ("sockjs"): console messages 1`] = `
342342
Array [

test/e2e/allowed-hosts.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ describe("allowed hosts", () => {
8888
await server.stop();
8989
});
9090

91-
it(`should disconnect web socket client using custom hostname from web socket server with the "auto" value based on the "host" header when "https" is enabled ("${webSocketServer}")`, async () => {
91+
it(`should disconnect web socket client using custom hostname from web socket server with the "auto" value based on the "host" header when "server: 'https'" is enabled ("${webSocketServer}")`, async () => {
9292
const devServerHost = "127.0.0.1";
9393
const devServerPort = port1;
9494
const proxyHost = devServerHost;
@@ -106,7 +106,7 @@ describe("allowed hosts", () => {
106106
port: devServerPort,
107107
host: devServerHost,
108108
allowedHosts: "auto",
109-
https: true,
109+
server: "https",
110110
};
111111
const server = new Server(devServerOptions, compiler);
112112

0 commit comments

Comments
 (0)