Skip to content

Commit f857c40

Browse files
chore: deps and tests
1 parent 41d1d0c commit f857c40

8 files changed

+1724
-5427
lines changed

package-lock.json

+1,668-5,404
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+11-11
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"loglevel": "^1.6.8",
5555
"opn": "^5.5.0",
5656
"p-retry": "^3.0.1",
57-
"portfinder": "^1.0.25",
57+
"portfinder": "^1.0.26",
5858
"schema-utils": "^1.0.0",
5959
"selfsigned": "^1.10.7",
6060
"semver": "^6.3.0",
@@ -72,10 +72,10 @@
7272
},
7373
"devDependencies": {
7474
"@babel/cli": "^7.8.4",
75-
"@babel/core": "^7.9.0",
76-
"@babel/plugin-transform-runtime": "^7.9.0",
77-
"@babel/preset-env": "^7.9.5",
78-
"@babel/runtime": "^7.9.2",
75+
"@babel/core": "^7.9.6",
76+
"@babel/plugin-transform-runtime": "^7.9.6",
77+
"@babel/preset-env": "^7.9.6",
78+
"@babel/runtime": "^7.9.6",
7979
"@commitlint/cli": "^8.3.5",
8080
"@commitlint/config-conventional": "^8.3.4",
8181
"babel-loader": "^8.1.0",
@@ -84,7 +84,7 @@
8484
"copy-webpack-plugin": "^5.1.1",
8585
"css-loader": "^2.1.1",
8686
"eslint": "^6.8.0",
87-
"eslint-config-prettier": "^6.10.1",
87+
"eslint-config-prettier": "^6.11.0",
8888
"eslint-config-webpack": "^1.2.5",
8989
"eslint-plugin-import": "^2.20.2",
9090
"execa": "^1.0.0",
@@ -94,23 +94,23 @@
9494
"husky": "^4.2.5",
9595
"jest": "^24.9.0",
9696
"jest-junit": "^10.0.0",
97-
"jquery": "^3.5.0",
97+
"jquery": "^3.5.1",
9898
"less": "^3.11.1",
9999
"less-loader": "^5.0.0",
100-
"lint-staged": "^10.1.3",
100+
"lint-staged": "^10.2.2",
101101
"marked": "^0.8.2",
102102
"memfs": "^3.1.2",
103103
"npm-run-all": "^4.1.5",
104104
"prettier": "^1.19.1",
105105
"puppeteer": "^1.20.0",
106106
"rimraf": "^3.0.2",
107-
"standard-version": "^7.1.0",
108-
"style-loader": "^1.1.3",
107+
"standard-version": "^8.0.0",
108+
"style-loader": "^1.2.1",
109109
"supertest": "^4.0.2",
110110
"tcp-port-used": "^1.0.1",
111111
"typescript": "^3.8.3",
112112
"url-loader": "^3.0.0",
113-
"webpack": "^4.42.1",
113+
"webpack": "^4.43.0",
114114
"webpack-cli": "^3.3.11"
115115
},
116116
"peerDependencies": {

test/cli/cli.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe('CLI', () => {
2020
testBin('--progress')
2121
.then((output) => {
2222
expect(output.code).toEqual(0);
23-
expect(output.stderr).toContain('0% compiling');
23+
expect(output.stderr).toContain('100%');
2424
// should not profile
2525
expect(output.stderr).not.toContain(
2626
'ms after chunk modules optimization'

test/helpers/isWebpack5.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict';
2+
3+
const webpack = require('webpack');
4+
5+
const isWebpack5 = webpack.version[0] === '5';
6+
7+
module.exports = isWebpack5;

test/server/Server.test.js

+28-8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const { noop } = require('webpack-dev-middleware/lib/util');
77
const Server = require('../../lib/Server');
88
const config = require('../fixtures/simple-config/webpack.config');
99
const port = require('../ports-map').Server;
10+
const isWebpack5 = require('../helpers/isWebpack5');
1011

1112
jest.mock('sockjs/lib/transport');
1213

@@ -34,11 +35,20 @@ describe('Server', () => {
3435
})
3536
);
3637

37-
expect(
38-
server.middleware.context.compiler.options.entry.map((p) => {
38+
let entries;
39+
40+
if (isWebpack5) {
41+
entries = server.middleware.context.compiler.options.entry.main.import.map(
42+
(p) => {
43+
return relative('.', p).split(sep);
44+
}
45+
);
46+
} else {
47+
entries = server.middleware.context.compiler.options.entry.map((p) => {
3948
return relative('.', p).split(sep);
40-
})
41-
).toMatchSnapshot();
49+
});
50+
}
51+
expect(entries).toMatchSnapshot();
4252
expect(server.middleware.context.compiler.options.plugins).toEqual([
4353
new webpack.HotModuleReplacementPlugin(),
4454
]);
@@ -59,11 +69,21 @@ describe('Server', () => {
5969
})
6070
);
6171

62-
expect(
63-
server.middleware.context.compiler.options.entry.map((p) => {
72+
let entries;
73+
74+
if (isWebpack5) {
75+
entries = server.middleware.context.compiler.options.entry.main.import.map(
76+
(p) => {
77+
return relative('.', p).split(sep);
78+
}
79+
);
80+
} else {
81+
entries = server.middleware.context.compiler.options.entry.map((p) => {
6482
return relative('.', p).split(sep);
65-
})
66-
).toMatchSnapshot();
83+
});
84+
}
85+
86+
expect(entries).toMatchSnapshot();
6787
expect(server.middleware.context.compiler.options.plugins).toEqual([
6888
new webpack.HotModuleReplacementPlugin(),
6989
]);

test/server/profile-option.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe('profile', () => {
3434
calls.forEach((call) => {
3535
const text = call[0];
3636

37-
if (text.includes('0% compiling')) {
37+
if (text.includes('2%')) {
3838
foundProgress = true;
3939
}
4040

test/server/progress-option.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe('progress', () => {
2929
let foundProgress = false;
3030
let foundProfile = false;
3131
calls.forEach((call) => {
32-
if (call[0].includes('0% compiling')) {
32+
if (call[0].includes('2%')) {
3333
foundProgress = true;
3434
}
3535

test/server/utils/updateCompiler.test.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
const webpack = require('webpack');
44
const updateCompiler = require('../../../lib/utils/updateCompiler');
5+
const isWebpack5 = require('../../helpers/isWebpack5');
56

67
describe('updateCompiler', () => {
78
describe('simple config, inline', () => {
@@ -36,7 +37,12 @@ describe('updateCompiler', () => {
3637
expect(compiler.hooks.entryOption.taps.length).toBe(1);
3738
expect(tapsByHMR).toEqual(0);
3839
expect(tapsByProvidePlugin).toEqual(1);
39-
expect(compiler.options.plugins).toBeUndefined();
40+
41+
if (isWebpack5) {
42+
expect(compiler.options.plugins).toEqual([]);
43+
} else {
44+
expect(compiler.options.plugins).toBeUndefined();
45+
}
4046
});
4147
});
4248

0 commit comments

Comments
 (0)