Skip to content

Commit 98f4eb6

Browse files
test: fix
1 parent 4d6b137 commit 98f4eb6

21 files changed

+129
-128
lines changed

test/e2e/app.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ describe("app option", () => {
148148
});
149149

150150
const pageUrl = devServer.isTlsServer
151-
? `https://127.0.0.1:${port}/`
152-
: `http://127.0.0.1:${port}/`;
151+
? `https://localhost:${port}/`
152+
: `http://localhost:${port}/`;
153153

154154
const response = await page.goto(pageUrl, {
155155
waitUntil: "networkidle0",

test/e2e/bonjour.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ describe("bonjour option", () => {
7171
pageErrors.push(error);
7272
});
7373

74-
const response = await page.goto(`http://127.0.0.1:${port}/`, {
74+
const response = await page.goto(`http://localhost:${port}/`, {
7575
waitUntil: "networkidle0",
7676
});
7777

@@ -144,7 +144,7 @@ describe("bonjour option", () => {
144144
pageErrors.push(error);
145145
});
146146

147-
const response = await page.goto(`https://127.0.0.1:${port}/`, {
147+
const response = await page.goto(`https://localhost:${port}/`, {
148148
waitUntil: "networkidle0",
149149
});
150150

@@ -226,7 +226,7 @@ describe("bonjour option", () => {
226226
pageErrors.push(error);
227227
});
228228

229-
const response = await page.goto(`http://127.0.0.1:${port}/`, {
229+
const response = await page.goto(`http://localhost:${port}/`, {
230230
waitUntil: "networkidle0",
231231
});
232232

@@ -312,7 +312,7 @@ describe("bonjour option", () => {
312312
pageErrors.push(error);
313313
});
314314

315-
const response = await page.goto(`https://127.0.0.1:${port}/`, {
315+
const response = await page.goto(`https://localhost:${port}/`, {
316316
waitUntil: "networkidle0",
317317
});
318318

test/e2e/built-in-routes.test.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe("Built in routes", () => {
4343
});
4444

4545
const response = await page.goto(
46-
`http://127.0.0.1:${port}/__webpack_dev_server__/sockjs.bundle.js`,
46+
`http://localhost:${port}/__webpack_dev_server__/sockjs.bundle.js`,
4747
{
4848
waitUntil: "networkidle0",
4949
},
@@ -77,7 +77,7 @@ describe("Built in routes", () => {
7777
});
7878

7979
const response = await page.goto(
80-
`http://127.0.0.1:${port}/__webpack_dev_server__/sockjs.bundle.js`,
80+
`http://localhost:${port}/__webpack_dev_server__/sockjs.bundle.js`,
8181
{
8282
waitUntil: "networkidle0",
8383
},
@@ -106,7 +106,7 @@ describe("Built in routes", () => {
106106
});
107107

108108
const response = await page.goto(
109-
`http://127.0.0.1:${port}/webpack-dev-server/invalidate`,
109+
`http://localhost:${port}/webpack-dev-server/invalidate`,
110110
{
111111
waitUntil: "networkidle0",
112112
},
@@ -133,7 +133,7 @@ describe("Built in routes", () => {
133133
});
134134

135135
const response = await page.goto(
136-
`http://127.0.0.1:${port}/webpack-dev-server/`,
136+
`http://localhost:${port}/webpack-dev-server/`,
137137
{
138138
waitUntil: "networkidle0",
139139
},
@@ -169,7 +169,7 @@ describe("Built in routes", () => {
169169
});
170170

171171
const response = await page.goto(
172-
`http://127.0.0.1:${port}/webpack-dev-server/`,
172+
`http://localhost:${port}/webpack-dev-server/`,
173173
{
174174
waitUntil: "networkidle0",
175175
},
@@ -199,7 +199,7 @@ describe("Built in routes", () => {
199199
pageErrors.push(error);
200200
});
201201

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

@@ -228,7 +228,7 @@ describe("Built in routes", () => {
228228
interceptedRequest.continue({ method: "HEAD" });
229229
});
230230

231-
const response = await page.goto(`http://127.0.0.1:${port}/main.js`, {
231+
const response = await page.goto(`http://localhost:${port}/main.js`, {
232232
waitUntil: "networkidle0",
233233
});
234234

@@ -279,7 +279,7 @@ describe("Built in routes", () => {
279279
});
280280

281281
const response = await page.goto(
282-
`http://127.0.0.1:${port}/webpack-dev-server/`,
282+
`http://localhost:${port}/webpack-dev-server/`,
283283
{
284284
waitUntil: "networkidle0",
285285
},

test/e2e/client.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ describe("client option", () => {
5151
pageErrors.push(error);
5252
});
5353

54-
const response = await page.goto(`http://127.0.0.1:${port}/ws`, {
54+
const response = await page.goto(`http://localhost:${port}/ws`, {
5555
waitUntil: "networkidle0",
5656
});
5757

@@ -120,7 +120,7 @@ describe("client option", () => {
120120
});
121121

122122
const response = await page.goto(
123-
`http://127.0.0.1:${port}/foo/test/bar`,
123+
`http://localhost:${port}/foo/test/bar`,
124124
{
125125
waitUntil: "networkidle0",
126126
},
@@ -177,7 +177,7 @@ describe("client option", () => {
177177
pageErrors.push(error);
178178
});
179179

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

@@ -235,7 +235,7 @@ describe("client option", () => {
235235
});
236236

237237
it("should disable client entry", async () => {
238-
const response = await page.goto(`http://127.0.0.1:${port}/main.js`, {
238+
const response = await page.goto(`http://localhost:${port}/main.js`, {
239239
waitUntil: "networkidle0",
240240
});
241241

test/e2e/compress.test.js

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

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

@@ -101,7 +101,7 @@ describe("compress option", () => {
101101
pageErrors.push(error);
102102
});
103103

104-
const response = await page.goto(`http://127.0.0.1:${port}/main.js`, {
104+
const response = await page.goto(`http://localhost:${port}/main.js`, {
105105
waitUntil: "networkidle0",
106106
});
107107

@@ -160,7 +160,7 @@ describe("compress option", () => {
160160
pageErrors.push(error);
161161
});
162162

163-
const response = await page.goto(`http://127.0.0.1:${port}/main.js`, {
163+
const response = await page.goto(`http://localhost:${port}/main.js`, {
164164
waitUntil: "networkidle0",
165165
});
166166

test/e2e/history-api-fallback.test.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ describe("historyApiFallback option", () => {
5151
pageErrors.push(error);
5252
});
5353

54-
const response = await page.goto(`http://127.0.0.1:${port}/foo`, {
54+
const response = await page.goto(`http://localhost:${port}/foo`, {
5555
waitUntil: "networkidle0",
5656
});
5757

@@ -114,7 +114,7 @@ describe("historyApiFallback option", () => {
114114
pageErrors.push(error);
115115
});
116116

117-
const response = await page.goto(`http://127.0.0.1:${port}/foo`, {
117+
const response = await page.goto(`http://localhost:${port}/foo`, {
118118
waitUntil: "networkidle0",
119119
});
120120

@@ -181,7 +181,7 @@ describe("historyApiFallback option", () => {
181181
pageErrors.push(error);
182182
});
183183

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

@@ -210,7 +210,7 @@ describe("historyApiFallback option", () => {
210210
});
211211

212212
const response = await page.goto(
213-
`http://127.0.0.1:${port}/random-file.txt`,
213+
`http://localhost:${port}/random-file.txt`,
214214
{
215215
waitUntil: "networkidle2",
216216
},
@@ -276,7 +276,7 @@ describe("historyApiFallback option", () => {
276276
pageErrors.push(error);
277277
});
278278

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

@@ -352,7 +352,7 @@ describe("historyApiFallback 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

@@ -380,7 +380,7 @@ describe("historyApiFallback option", () => {
380380
pageErrors.push(error);
381381
});
382382

383-
const response = await page.goto(`http://127.0.0.1:${port}/acme`, {
383+
const response = await page.goto(`http://localhost:${port}/acme`, {
384384
waitUntil: "networkidle0",
385385
});
386386

@@ -408,7 +408,7 @@ describe("historyApiFallback option", () => {
408408
pageErrors.push(error);
409409
});
410410

411-
const response = await page.goto(`http://127.0.0.1:${port}/other`, {
411+
const response = await page.goto(`http://localhost:${port}/other`, {
412412
waitUntil: "networkidle0",
413413
});
414414

@@ -476,7 +476,7 @@ describe("historyApiFallback option", () => {
476476
pageErrors.push(error);
477477
});
478478

479-
const response = await page.goto(`http://127.0.0.1:${port}/foo`, {
479+
const response = await page.goto(`http://localhost:${port}/foo`, {
480480
waitUntil: "networkidle0",
481481
});
482482

@@ -552,7 +552,7 @@ describe("historyApiFallback option", () => {
552552
pageErrors.push(error);
553553
});
554554

555-
const response = await page.goto(`http://127.0.0.1:${port}/foo`, {
555+
const response = await page.goto(`http://localhost:${port}/foo`, {
556556
waitUntil: "networkidle0",
557557
});
558558

@@ -625,7 +625,7 @@ describe("historyApiFallback option", () => {
625625
pageErrors.push(error);
626626
});
627627

628-
const response = await page.goto(`http://127.0.0.1:${port}/foo`, {
628+
const response = await page.goto(`http://localhost:${port}/foo`, {
629629
waitUntil: "networkidle0",
630630
});
631631

@@ -645,7 +645,7 @@ describe("historyApiFallback option", () => {
645645
});
646646

647647
it("should perform HEAD request in same way as GET", async () => {
648-
await page.goto(`http://127.0.0.1:${port}/foo`, {
648+
await page.goto(`http://localhost:${port}/foo`, {
649649
waitUntil: "networkidle0",
650650
});
651651

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -354,11 +354,11 @@ describe("hot and live reload", () => {
354354

355355
if (webSocketTransport === "ws") {
356356
const ws = new WebSocket(
357-
`ws://127.0.0.1:${devServerOptions.port}/ws`,
357+
`ws://localhost:${devServerOptions.port}/ws`,
358358
{
359359
headers: {
360-
host: `127.0.0.1:${devServerOptions.port}`,
361-
origin: `http://127.0.0.1:${devServerOptions.port}`,
360+
host: `localhost:${devServerOptions.port}`,
361+
origin: `http://localhost:${devServerOptions.port}`,
362362
},
363363
},
364364
);
@@ -400,7 +400,7 @@ describe("hot and live reload", () => {
400400
});
401401
} else {
402402
const sockjs = new SockJS(
403-
`http://127.0.0.1:${devServerOptions.port}/ws`,
403+
`http://localhost:${devServerOptions.port}/ws`,
404404
);
405405

406406
let opened = false;
@@ -624,7 +624,7 @@ describe("simple hot config HMR plugin", () => {
624624
pageErrors.push(error);
625625
});
626626

627-
const response = await page.goto(`http://127.0.0.1:${port}/`, {
627+
const response = await page.goto(`http://localhost:${port}/`, {
628628
waitUntil: "networkidle0",
629629
});
630630

@@ -691,7 +691,7 @@ describe("simple hot config HMR plugin with already added HMR plugin", () => {
691691
pageErrors.push(error);
692692
});
693693

694-
const response = await page.goto(`http://127.0.0.1:${port}/`, {
694+
const response = await page.goto(`http://localhost:${port}/`, {
695695
waitUntil: "networkidle0",
696696
});
697697

@@ -822,7 +822,7 @@ describe("multi compiler hot config HMR plugin", () => {
822822
pageErrors.push(error);
823823
});
824824

825-
const response = await page.goto(`http://127.0.0.1:${port}/`, {
825+
const response = await page.goto(`http://localhost:${port}/`, {
826826
waitUntil: "networkidle0",
827827
});
828828

@@ -885,7 +885,7 @@ describe("hot disabled HMR plugin", () => {
885885
pageErrors.push(error);
886886
});
887887

888-
const response = await page.goto(`http://127.0.0.1:${port}/`, {
888+
const response = await page.goto(`http://localhost:${port}/`, {
889889
waitUntil: "networkidle0",
890890
});
891891

test/e2e/lazy-compilation.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe("lazy compilation", () => {
2929
pageErrors.push(error);
3030
});
3131

32-
await page.goto(`http://127.0.0.1:${port}/test.html`, {
32+
await page.goto(`http://localhost:${port}/test.html`, {
3333
waitUntil: "domcontentloaded",
3434
});
3535
await new Promise((resolve) => {
@@ -72,7 +72,7 @@ describe("lazy compilation", () => {
7272
pageErrors.push(error);
7373
});
7474

75-
await page.goto(`http://127.0.0.1:${port}/test-one.html`, {
75+
await page.goto(`http://localhost:${port}/test-one.html`, {
7676
waitUntil: "domcontentloaded",
7777
});
7878
await new Promise((resolve) => {
@@ -86,7 +86,7 @@ describe("lazy compilation", () => {
8686
}, 100);
8787
});
8888

89-
await page.goto(`http://127.0.0.1:${port}/test-two.html`, {
89+
await page.goto(`http://localhost:${port}/test-two.html`, {
9090
waitUntil: "domcontentloaded",
9191
});
9292
await new Promise((resolve) => {

test/e2e/mime-types.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ describe("mimeTypes option", () => {
5252
pageErrors.push(error);
5353
});
5454

55-
const response = await page.goto(`http://127.0.0.1:${port}/main.js`, {
55+
const response = await page.goto(`http://localhost:${port}/main.js`, {
5656
waitUntil: "networkidle0",
5757
});
5858

@@ -115,7 +115,7 @@ describe("mimeTypes option", () => {
115115
pageErrors.push(error);
116116
});
117117

118-
const response = await page.goto(`http://127.0.0.1:${port}/file.custom`, {
118+
const response = await page.goto(`http://localhost:${port}/file.custom`, {
119119
waitUntil: "networkidle0",
120120
});
121121

0 commit comments

Comments
 (0)