Skip to content

Commit c1ea23f

Browse files
test: fix
1 parent 639666b commit c1ea23f

File tree

9 files changed

+71
-40
lines changed

9 files changed

+71
-40
lines changed

.cspell.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@
7070
"commitlint",
7171
"eslintcache",
7272
"hono",
73-
"privkey"
73+
"privkey",
74+
"geomanist"
7475
],
7576
"ignorePaths": [
7677
"CHANGELOG.md",

examples/.assets/style.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ table {
7474
code {
7575
background-color: rgba(70, 94, 105, 0.06);
7676
border-radius: 3px;
77-
font-family: "Source Code Pro", Consolas, "Liberation Mono", Menlo, Courier,
78-
monospace;
77+
font-family:
78+
"Source Code Pro", Consolas, "Liberation Mono", Menlo, Courier, monospace;
7979
font-size: 1.44rem;
8080
margin: 0;
8181
max-width: 100%;

test/e2e/__snapshots__/client-reconnect.test.js.snap.webpack5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ exports[`client.reconnect option specified as number should try to reconnect 2 t
2020
"Hey.",
2121
"[webpack-dev-server] Disconnected!",
2222
"[webpack-dev-server] Trying to reconnect...",
23-
"WebSocket connection to 'ws://127.0.0.1:8163/ws' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED",
23+
"WebSocket connection to 'ws://localhost:8163/ws' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED",
2424
"[webpack-dev-server] JSHandle@object",
2525
"[webpack-dev-server] Trying to reconnect...",
26-
"WebSocket connection to 'ws://127.0.0.1:8163/ws' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED",
26+
"WebSocket connection to 'ws://localhost:8163/ws' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED",
2727
"[webpack-dev-server] JSHandle@object",
2828
]
2929
`;

test/e2e/__snapshots__/compress.test.js.snap.webpack5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ exports[`compress option as true should handle GET request to bundle file: conso
1212

1313
exports[`compress option as true should handle GET request to bundle file: page errors 1`] = `[]`;
1414

15-
exports[`compress option as true should handle GET request to bundle file: response headers content-encoding 1`] = `"gzip"`;
15+
exports[`compress option as true should handle GET request to bundle file: response headers content-encoding 1`] = `"br"`;
1616

1717
exports[`compress option as true should handle GET request to bundle file: response status 1`] = `200`;
1818

1919
exports[`compress option enabled by default when not specified should handle GET request to bundle file: console messages 1`] = `[]`;
2020

2121
exports[`compress option enabled by default when not specified should handle GET request to bundle file: page errors 1`] = `[]`;
2222

23-
exports[`compress option enabled by default when not specified should handle GET request to bundle file: response headers content-encoding 1`] = `"gzip"`;
23+
exports[`compress option enabled by default when not specified should handle GET request to bundle file: response headers content-encoding 1`] = `"br"`;
2424

2525
exports[`compress option enabled by default when not specified should handle GET request to bundle file: response status 1`] = `200`;

test/e2e/client-reconnect.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ describe("client.reconnect option", () => {
4141
pageErrors.push(error);
4242
});
4343

44-
const response = await page.goto(`http://127.0.0.1:${port}/`, {
44+
const response = await page.goto(`http://localhost:${port}/`, {
4545
waitUntil: "networkidle0",
4646
});
4747

@@ -107,7 +107,7 @@ describe("client.reconnect option", () => {
107107
pageErrors.push(error);
108108
});
109109

110-
const response = await page.goto(`http://127.0.0.1:${port}/`, {
110+
const response = await page.goto(`http://localhost:${port}/`, {
111111
waitUntil: "networkidle0",
112112
});
113113

@@ -172,7 +172,7 @@ describe("client.reconnect option", () => {
172172
pageErrors.push(error);
173173
});
174174

175-
const response = await page.goto(`http://127.0.0.1:${port}/`, {
175+
const response = await page.goto(`http://localhost:${port}/`, {
176176
waitUntil: "networkidle0",
177177
});
178178

test/e2e/entry.test.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ describe("entry", () => {
5555
pageErrors.push(error);
5656
});
5757

58-
await page.goto(`http://127.0.0.1:${port}/`, {
58+
await page.goto(`http://localhost:${port}/`, {
5959
waitUntil: "networkidle0",
6060
});
6161

@@ -94,7 +94,7 @@ describe("entry", () => {
9494
pageErrors.push(error);
9595
});
9696

97-
await page.goto(`http://127.0.0.1:${port}/`, {
97+
await page.goto(`http://localhost:${port}/`, {
9898
waitUntil: "networkidle0",
9999
});
100100

@@ -138,7 +138,7 @@ describe("entry", () => {
138138
pageErrors.push(error);
139139
});
140140

141-
await page.goto(`http://127.0.0.1:${port}/`, {
141+
await page.goto(`http://localhost:${port}/`, {
142142
waitUntil: "networkidle0",
143143
});
144144

@@ -177,7 +177,7 @@ describe("entry", () => {
177177
pageErrors.push(error);
178178
});
179179

180-
await page.goto(`http://127.0.0.1:${port}/`, {
180+
await page.goto(`http://localhost:${port}/`, {
181181
waitUntil: "networkidle0",
182182
});
183183

@@ -219,7 +219,7 @@ describe("entry", () => {
219219
pageErrors.push(error);
220220
});
221221

222-
await page.goto(`http://127.0.0.1:${port}/`, {
222+
await page.goto(`http://localhost:${port}/`, {
223223
waitUntil: "networkidle0",
224224
});
225225

@@ -269,11 +269,11 @@ describe("entry", () => {
269269
pageErrors.push(error);
270270
});
271271

272-
await page.goto(`http://127.0.0.1:${port}/test.html`, {
272+
await page.goto(`http://localhost:${port}/test.html`, {
273273
waitUntil: "networkidle0",
274274
});
275-
await page.addScriptTag({ url: `http://127.0.0.1:${port}/runtime.js` });
276-
await page.addScriptTag({ url: `http://127.0.0.1:${port}/foo.js` });
275+
await page.addScriptTag({ url: `http://localhost:${port}/runtime.js` });
276+
await page.addScriptTag({ url: `http://localhost:${port}/foo.js` });
277277
await waitForConsoleLogFinished(consoleMessages);
278278

279279
expect(consoleMessages).toMatchSnapshot("console messages");
@@ -320,11 +320,11 @@ describe("entry", () => {
320320
pageErrors.push(error);
321321
});
322322

323-
await page.goto(`http://127.0.0.1:${port}/test.html`, {
323+
await page.goto(`http://localhost:${port}/test.html`, {
324324
waitUntil: "networkidle0",
325325
});
326-
await page.addScriptTag({ url: `http://127.0.0.1:${port}/runtime.js` });
327-
await page.addScriptTag({ url: `http://127.0.0.1:${port}/bar.js` });
326+
await page.addScriptTag({ url: `http://localhost:${port}/runtime.js` });
327+
await page.addScriptTag({ url: `http://localhost:${port}/bar.js` });
328328
await waitForConsoleLogFinished(consoleMessages);
329329

330330
expect(consoleMessages).toMatchSnapshot("console messages");
@@ -369,11 +369,11 @@ describe("entry", () => {
369369
pageErrors.push(error);
370370
});
371371

372-
await page.goto(`http://127.0.0.1:${port}/test.html`, {
372+
await page.goto(`http://localhost:${port}/test.html`, {
373373
waitUntil: "networkidle0",
374374
});
375-
await page.addScriptTag({ url: `http://127.0.0.1:${port}/bar.js` });
376-
await page.addScriptTag({ url: `http://127.0.0.1:${port}/foo.js` });
375+
await page.addScriptTag({ url: `http://localhost:${port}/bar.js` });
376+
await page.addScriptTag({ url: `http://localhost:${port}/foo.js` });
377377
await waitForConsoleLogFinished(consoleMessages);
378378

379379
expect(consoleMessages).toMatchSnapshot("console messages");
@@ -417,7 +417,7 @@ describe("entry", () => {
417417
pageErrors.push(error);
418418
});
419419

420-
await page.goto(`http://127.0.0.1:${port}/`, {
420+
await page.goto(`http://localhost:${port}/`, {
421421
waitUntil: "networkidle0",
422422
});
423423

test/e2e/headers.test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ describe("headers option", () => {
4949
pageErrors.push(error);
5050
});
5151

52-
const response = await page.goto(`http://127.0.0.1:${port}/`, {
52+
const response = await page.goto(`http://localhost:${port}/`, {
5353
waitUntil: "networkidle0",
5454
});
5555

@@ -117,7 +117,7 @@ describe("headers option", () => {
117117
pageErrors.push(error);
118118
});
119119

120-
const response = await page.goto(`http://127.0.0.1:${port}/`, {
120+
const response = await page.goto(`http://localhost:${port}/`, {
121121
waitUntil: "networkidle0",
122122
});
123123

@@ -180,7 +180,7 @@ describe("headers option", () => {
180180
pageErrors.push(error);
181181
});
182182

183-
const response = await page.goto(`http://127.0.0.1:${port}/`, {
183+
const response = await page.goto(`http://localhost:${port}/`, {
184184
waitUntil: "networkidle0",
185185
});
186186

@@ -241,7 +241,7 @@ describe("headers option", () => {
241241
pageErrors.push(error);
242242
});
243243

244-
const response = await page.goto(`http://127.0.0.1:${port}/`, {
244+
const response = await page.goto(`http://localhost:${port}/`, {
245245
waitUntil: "networkidle0",
246246
});
247247

@@ -309,7 +309,7 @@ describe("headers option", () => {
309309
pageErrors.push(error);
310310
});
311311

312-
const response = await page.goto(`http://127.0.0.1:${port}/`, {
312+
const response = await page.goto(`http://localhost:${port}/`, {
313313
waitUntil: "networkidle0",
314314
});
315315

@@ -375,7 +375,7 @@ describe("headers option", () => {
375375
pageErrors.push(error);
376376
});
377377

378-
const response = await page.goto(`http://127.0.0.1:${port}/`, {
378+
const response = await page.goto(`http://localhost:${port}/`, {
379379
waitUntil: "networkidle0",
380380
});
381381

@@ -437,7 +437,7 @@ describe("headers option", () => {
437437
pageErrors.push(error);
438438
});
439439

440-
const response = await page.goto(`http://127.0.0.1:${port}/`, {
440+
const response = await page.goto(`http://localhost:${port}/`, {
441441
waitUntil: "networkidle0",
442442
});
443443

test/e2e/host.test.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,16 @@ describe("host", () => {
7979
devServerOptions.host = host;
8080
}
8181

82+
if (
83+
host === "<not-specified>" ||
84+
typeof host === "undefined" ||
85+
host === "0.0.0.0" ||
86+
host === "::" ||
87+
host === "local-ipv6"
88+
) {
89+
devServerOptions.allowedHosts = "all";
90+
}
91+
8292
const server = new Server(devServerOptions, compiler);
8393

8494
let hostname = host;
@@ -145,6 +155,16 @@ describe("host", () => {
145155
devServerOptions.host = host;
146156
}
147157

158+
if (
159+
host === "<not-specified>" ||
160+
typeof host === "undefined" ||
161+
host === "0.0.0.0" ||
162+
host === "::" ||
163+
host === "local-ipv6"
164+
) {
165+
devServerOptions.allowedHosts = "all";
166+
}
167+
148168
const server = new Server(devServerOptions, compiler);
149169

150170
let hostname = host;
@@ -214,6 +234,16 @@ describe("host", () => {
214234
devServerOptions.host = host;
215235
}
216236

237+
if (
238+
host === "<not-specified>" ||
239+
typeof host === "undefined" ||
240+
host === "0.0.0.0" ||
241+
host === "::" ||
242+
host === "local-ipv6"
243+
) {
244+
devServerOptions.allowedHosts = "all";
245+
}
246+
217247
const server = new Server(devServerOptions, compiler);
218248

219249
let hostname = host;

test/e2e/watch-files.test.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ describe("watchFiles option", () => {
5858
pageErrors.push(error);
5959
});
6060

61-
const response = await page.goto(`http://127.0.0.1:${port}/`, {
61+
const response = await page.goto(`http://localhost:${port}/`, {
6262
waitUntil: "networkidle0",
6363
});
6464

@@ -129,7 +129,7 @@ describe("watchFiles option", () => {
129129
pageErrors.push(error);
130130
});
131131

132-
const response = await page.goto(`http://127.0.0.1:${port}/`, {
132+
const response = await page.goto(`http://localhost:${port}/`, {
133133
waitUntil: "networkidle0",
134134
});
135135

@@ -200,7 +200,7 @@ describe("watchFiles option", () => {
200200
pageErrors.push(error);
201201
});
202202

203-
const response = await page.goto(`http://127.0.0.1:${port}/`, {
203+
const response = await page.goto(`http://localhost:${port}/`, {
204204
waitUntil: "networkidle0",
205205
});
206206

@@ -276,7 +276,7 @@ describe("watchFiles option", () => {
276276
pageErrors.push(error);
277277
});
278278

279-
const response = await page.goto(`http://127.0.0.1:${port}/`, {
279+
const response = await page.goto(`http://localhost:${port}/`, {
280280
waitUntil: "networkidle0",
281281
});
282282

@@ -352,7 +352,7 @@ describe("watchFiles option", () => {
352352
pageErrors.push(error);
353353
});
354354

355-
const response = await page.goto(`http://127.0.0.1:${port}/`, {
355+
const response = await page.goto(`http://localhost:${port}/`, {
356356
waitUntil: "networkidle0",
357357
});
358358

@@ -425,7 +425,7 @@ describe("watchFiles option", () => {
425425
pageErrors.push(error);
426426
});
427427

428-
const response = await page.goto(`http://127.0.0.1:${port}/`, {
428+
const response = await page.goto(`http://localhost:${port}/`, {
429429
waitUntil: "networkidle0",
430430
});
431431

@@ -506,7 +506,7 @@ describe("watchFiles option", () => {
506506
pageErrors.push(error);
507507
});
508508

509-
const response = await page.goto(`http://127.0.0.1:${port}/`, {
509+
const response = await page.goto(`http://localhost:${port}/`, {
510510
waitUntil: "networkidle0",
511511
});
512512

@@ -647,7 +647,7 @@ describe("watchFiles option", () => {
647647
pageErrors.push(error);
648648
});
649649

650-
const response = await page.goto(`http://127.0.0.1:${port}/`, {
650+
const response = await page.goto(`http://localhost:${port}/`, {
651651
waitUntil: "networkidle0",
652652
});
653653

0 commit comments

Comments
 (0)