Skip to content

Commit c10ca11

Browse files
committed
chore: update webpack-dev-middleware
1 parent d164aea commit c10ca11

File tree

5 files changed

+49
-34
lines changed

5 files changed

+49
-34
lines changed

package-lock.json

Lines changed: 21 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"strip-ansi": "^6.0.0",
6363
"url": "^0.11.0",
6464
"util": "^0.12.3",
65-
"webpack-dev-middleware": "^4.0.2",
65+
"webpack-dev-middleware": "^4.1.0",
6666
"ws": "^7.4.3"
6767
},
6868
"devDependencies": {

setupTest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
process.env.CHOKIDAR_USEPOLLING = true;
4-
jest.setTimeout(120000);
4+
jest.setTimeout(180000);
55

66
// retry 3 times for flaky tests
77
jest.retryTimes(3);

test/cli/cli.test.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ describe('CLI', () => {
1414
testBin('--hot')
1515
.then((output) => {
1616
expect(output.exitCode).toEqual(0);
17-
expect(output.stderr).toContain('webpack/hot/dev-server.js');
17+
expect(output.stdout).toContain('webpack/hot/dev-server.js');
1818
done();
1919
})
2020
.catch(done);
@@ -24,7 +24,7 @@ describe('CLI', () => {
2424
testBin('--no-hot')
2525
.then((output) => {
2626
expect(output.exitCode).toEqual(0);
27-
expect(output.stderr).not.toContain('webpack/hot/dev-server.js');
27+
expect(output.stdout).not.toContain('webpack/hot/dev-server.js');
2828
done();
2929
})
3030
.catch(done);
@@ -35,7 +35,7 @@ describe('CLI', () => {
3535
testBin('--hot --stats=detailed')
3636
.then((output) => {
3737
expect(output.exitCode).toEqual(0);
38-
expect(output.stderr).toContain('webpack/hot/dev-server.js');
38+
expect(output.stdout).toContain('webpack/hot/dev-server.js');
3939
done();
4040
})
4141
.catch(done);
@@ -45,7 +45,7 @@ describe('CLI', () => {
4545
testBin('--no-hot --stats=detailed')
4646
.then((output) => {
4747
expect(output.exitCode).toEqual(0);
48-
expect(output.stderr).not.toContain('webpack/hot/dev-server.js');
48+
expect(output.stdout).not.toContain('webpack/hot/dev-server.js');
4949
done();
5050
})
5151
.catch(done);
@@ -56,7 +56,7 @@ describe('CLI', () => {
5656
testBin('--hot-only --stats detailed')
5757
.then((output) => {
5858
expect(output.exitCode).toEqual(0);
59-
expect(output.stderr).toContain('/hot/only-dev-server');
59+
expect(output.stdout).toContain('/hot/only-dev-server');
6060
done();
6161
})
6262
.catch(done);
@@ -152,7 +152,7 @@ describe('CLI', () => {
152152
expect(err.stderr).toContain(
153153
"webpack output is served from '/foo/bar' URL"
154154
);
155-
expect(err.stderr).toContain('Compiled successfully.');
155+
expect(err.stdout).toContain('main.js');
156156
done();
157157
});
158158
});
@@ -177,7 +177,7 @@ describe('CLI', () => {
177177
expect(err.stderr).toContain(
178178
`Content not from webpack is served from '${staticDirectory}' directory`
179179
);
180-
expect(err.stderr).toContain('Compiled successfully.');
180+
expect(err.stdout).toContain('main.js');
181181
done();
182182
});
183183
});
@@ -193,7 +193,7 @@ describe('CLI', () => {
193193
})
194194
.catch((err) => {
195195
// for windows
196-
expect(err.stderr).toContain('Compiled successfully.');
196+
expect(err.stdout).toContain('main.js');
197197
done();
198198
});
199199
});
@@ -203,10 +203,10 @@ describe('CLI', () => {
203203
const examplePath = path.resolve(__dirname, '../../examples/cli/public');
204204
const cp = execa('node', [cliPath], { cwd: examplePath });
205205

206-
cp.stderr.on('data', (data) => {
206+
cp.stdout.on('data', (data) => {
207207
const bits = data.toString();
208208

209-
if (/Compiled successfully/.test(bits)) {
209+
if (/main.js/.test(bits)) {
210210
expect(cp.pid !== 0).toBe(true);
211211

212212
cp.kill('SIGINT');
@@ -225,7 +225,7 @@ describe('CLI', () => {
225225

226226
let killed = false;
227227

228-
cp.stderr.on('data', () => {
228+
cp.stdout.on('data', () => {
229229
if (!killed) {
230230
expect(cp.pid !== 0).toBe(true);
231231

@@ -245,10 +245,10 @@ describe('CLI', () => {
245245
const examplePath = path.resolve(__dirname, '../../examples/cli/public');
246246
const cp = execa('node', [cliPath, '--stdin'], { cwd: examplePath });
247247

248-
cp.stderr.on('data', (data) => {
248+
cp.stdout.on('data', (data) => {
249249
const bits = data.toString();
250250

251-
if (/Compiled successfully/.test(bits)) {
251+
if (/main.js/.test(bits)) {
252252
expect(cp.pid !== 0).toBe(true);
253253

254254
cp.stdin.write('hello');
@@ -268,7 +268,7 @@ describe('CLI', () => {
268268

269269
let killed = false;
270270

271-
cp.stderr.on('data', () => {
271+
cp.stdout.on('data', () => {
272272
if (!killed) {
273273
expect(cp.pid !== 0).toBe(true);
274274

test/e2e/DevServer.test.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ describe('DevServer', () => {
1010
testBin('--config ./test/fixtures/dev-server/default-config.js')
1111
.then((output) => {
1212
expect(output.exitCode).toEqual(0);
13-
expect(output.stderr).toContain('client/default/index.js?');
13+
expect(output.stdout).toContain('client/default/index.js?');
1414
done();
1515
})
1616
.catch(done);
@@ -22,8 +22,8 @@ describe('DevServer', () => {
2222
)
2323
.then((output) => {
2424
expect(output.exitCode).toEqual(0);
25-
expect(output.stderr).toContain('client/default/index.js?');
26-
expect(output.stderr).toContain('foo.js');
25+
expect(output.stdout).toContain('client/default/index.js?');
26+
expect(output.stdout).toContain('foo.js');
2727
done();
2828
})
2929
.catch(done);
@@ -35,7 +35,7 @@ describe('DevServer', () => {
3535
)
3636
.then((output) => {
3737
expect(output.exitCode).toEqual(0);
38-
expect(output.stderr).toContain('foo.js');
38+
expect(output.stdout).toContain('foo.js');
3939
done();
4040
})
4141
.catch(done);
@@ -47,8 +47,8 @@ describe('DevServer', () => {
4747
)
4848
.then((output) => {
4949
expect(output.exitCode).toEqual(0);
50-
expect(output.stderr).toContain('client/default/index.js?');
51-
expect(output.stderr).toContain('foo.js');
50+
expect(output.stdout).toContain('client/default/index.js?');
51+
expect(output.stdout).toContain('foo.js');
5252
done();
5353
})
5454
.catch(done);
@@ -60,8 +60,8 @@ describe('DevServer', () => {
6060
)
6161
.then((output) => {
6262
expect(output.exitCode).toEqual(0);
63-
expect(output.stderr).not.toContain('client/default/index.js?');
64-
expect(output.stderr).toContain('foo.js');
63+
expect(output.stdout).not.toContain('client/default/index.js?');
64+
expect(output.stdout).toContain('foo.js');
6565
done();
6666
})
6767
.catch(done);
@@ -73,7 +73,7 @@ describe('DevServer', () => {
7373
)
7474
.then((output) => {
7575
expect(output.exitCode).toEqual(0);
76-
expect(output.stderr).toContain('webpack/hot/dev-server');
76+
expect(output.stdout).toContain('webpack/hot/dev-server');
7777
done();
7878
})
7979
.catch(done);
@@ -83,7 +83,7 @@ describe('DevServer', () => {
8383
testBin('--config ./test/fixtures/dev-server/client-default-path-config.js')
8484
.then((output) => {
8585
expect(output.exitCode).toEqual(0);
86-
expect(output.stderr).not.toContain('&path=/ws');
86+
expect(output.stdout).not.toContain('&path=/ws');
8787
done();
8888
})
8989
.catch(done);
@@ -93,7 +93,7 @@ describe('DevServer', () => {
9393
testBin('--config ./test/fixtures/dev-server/client-custom-path-config.js')
9494
.then((output) => {
9595
expect(output.exitCode).toEqual(0);
96-
expect(output.stderr).toContain('&path=/custom/path');
96+
expect(output.stdout).toContain('&path=/custom/path');
9797
done();
9898
})
9999
.catch(done);
@@ -105,7 +105,7 @@ describe('DevServer', () => {
105105
testBin('--config ./test/fixtures/dev-server/target-config.js')
106106
.then((output) => {
107107
expect(output.exitCode).toEqual(0);
108-
expect(output.stderr).toContain('client/default/index.js');
108+
expect(output.stdout).toContain('client/default/index.js');
109109
done();
110110
})
111111
.catch(done);

0 commit comments

Comments
 (0)