Skip to content

Commit 4f74c6e

Browse files
hiroppyalexander-akait
authored andcommitted
chore(deps): update del, supports-color, import-local and execa (#2178)
1 parent fb1e2b1 commit 4f74c6e

File tree

2 files changed

+45
-61
lines changed

2 files changed

+45
-61
lines changed

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@
4242
"compression": "^1.7.4",
4343
"connect-history-api-fallback": "^1.6.0",
4444
"debug": "^4.1.1",
45-
"del": "^4.1.1",
45+
"del": "^5.0.0",
4646
"express": "^4.17.1",
4747
"html-entities": "^1.2.1",
48-
"http-proxy-middleware": "0.19.1",
49-
"import-local": "^2.0.0",
48+
"http-proxy-middleware": "^0.19.1",
49+
"import-local": "^3.0.2",
5050
"internal-ip": "^4.3.0",
5151
"ip": "^1.1.5",
5252
"is-absolute-url": "^3.0.3",
@@ -62,7 +62,7 @@
6262
"sockjs-client": "1.4.0",
6363
"spdy": "^4.0.1",
6464
"strip-ansi": "^3.0.1",
65-
"supports-color": "^6.1.0",
65+
"supports-color": "^7.0.0",
6666
"url": "^0.11.0",
6767
"webpack-dev-middleware": "^3.7.2",
6868
"webpack-log": "^2.0.0",
@@ -86,7 +86,7 @@
8686
"eslint-config-prettier": "^6.10.0",
8787
"eslint-config-webpack": "^1.2.5",
8888
"eslint-plugin-import": "^2.20.0",
89-
"execa": "^1.0.0",
89+
"execa": "^2.0.3",
9090
"file-loader": "^5.0.2",
9191
"html-loader": "^0.5.5",
9292
"html-webpack-plugin": "^3.2.0",

test/cli/cli.test.js

Lines changed: 40 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/**
2+
* @jest-environment node
3+
*/
4+
15
'use strict';
26

37
const { join, resolve } = require('path');
@@ -16,20 +20,6 @@ const keyPath = resolve(httpsCertificateDirectory, 'server.key');
1620
const certPath = resolve(httpsCertificateDirectory, 'server.crt');
1721

1822
describe('CLI', () => {
19-
it('--progress', (done) => {
20-
testBin('--progress')
21-
.then((output) => {
22-
expect(output.code).toEqual(0);
23-
expect(output.stderr).toContain('0% compiling');
24-
// should not profile
25-
expect(output.stderr).not.toContain(
26-
'ms after chunk modules optimization'
27-
);
28-
done();
29-
})
30-
.catch(done);
31-
});
32-
3323
it('--quiet', async (done) => {
3424
const output = await testBin(`--quiet --colors=false --port ${port1}`);
3525
expect(output.code).toEqual(0);
@@ -42,43 +32,41 @@ describe('CLI', () => {
4232
done();
4333
});
4434

35+
it('--progress', async () => {
36+
const { exitCode, stderr } = await testBin('--progress');
37+
expect(exitCode).toEqual(0);
38+
expect(stderr.includes('0% compiling')).toBe(true);
39+
// should not profile
40+
expect(output.stderr).not.toContain(
41+
'ms after chunk modules optimization'
42+
);
43+
});
44+
4545
it('--progress --profile', async () => {
46-
const { code, stderr } = await testBin('--progress --profile');
47-
expect(code).toEqual(0);
46+
const { exitCode, stderr } = await testBin('--progress --profile');
47+
expect(exitCode).toEqual(0);
4848
// should profile
4949
expect(stderr.includes('after chunk modules optimization')).toBe(true);
5050
});
5151

52-
it('--bonjour', (done) => {
53-
testBin('--bonjour')
54-
.then((output) => {
55-
expect(output.code).toEqual(0);
56-
expect(output.stdout).toContain('Bonjour');
57-
done();
58-
})
59-
.catch(done);
52+
it('--bonjour', async () => {
53+
const { exitCode, stdout } = await testBin('--bonjour');
54+
expect(exitCode).toEqual(0);
55+
expect(stdout.includes('Bonjour')).toBe(true);
6056
});
6157

62-
it('--https', (done) => {
63-
testBin('--https')
64-
.then((output) => {
65-
expect(output.code).toEqual(0);
66-
expect(output.stdout).toContain('Project is running at');
67-
done();
68-
})
69-
.catch(done);
58+
it('--https', async () => {
59+
const { exitCode, stdout } = await testBin('--https');
60+
expect(exitCode).toEqual(0);
61+
expect(stdout.includes('Project is running at')).toBe(true);
7062
});
7163

7264
it('--https --cacert --pfx --key --cert --pfx-passphrase', async () => {
73-
const { code, stdout } = await testBin(
65+
const { exitCode, stdout } = await testBin(
7466
`--https --cacert ${caPath} --pfx ${pfxPath} --key ${keyPath} --cert ${certPath} --pfx-passphrase webpack-dev-server`
75-
)
76-
.then((output) => {
77-
expect(output.code).toEqual(0);
78-
expect(output.stdout).toContain('Project is running at');
79-
done();
80-
})
81-
.catch(done);
67+
);
68+
expect(exitCode).toEqual(0);
69+
expect(stdout.includes('Project is running at')).toBe(true);
8270
});
8371

8472
it('--sockPath', async () => {
@@ -108,8 +96,8 @@ describe('CLI', () => {
10896
// The Unix socket to listen to (instead of a host).
10997
it('--socket', async () => {
11098
const socketPath = join('.', 'webpack.sock');
111-
const { code, stdout } = await testBin(`--socket ${socketPath}`);
112-
expect(code).toEqual(0);
99+
const { exitCode, stdout } = await testBin(`--socket ${socketPath}`);
100+
expect(exitCode).toEqual(0);
113101

114102
if (process.platform !== 'win32') {
115103
expect(stdout.includes(socketPath)).toBe(true);
@@ -131,20 +119,16 @@ describe('CLI', () => {
131119
.catch(done);
132120
});
133121

134-
it('should accept the promise function of webpack.config.js', (done) => {
135-
testBin(
136-
false,
137-
resolve(__dirname, '../fixtures/promise-config/webpack.config.js')
138-
)
139-
.then((output) => {
140-
expect(output.code).toEqual(0);
141-
done();
142-
})
143-
.catch((err) => {
144-
// for windows
145-
expect(err.stdout).toContain('Compiled successfully.');
146-
done();
147-
});
122+
it('should accept the promise function of webpack.config.js', async () => {
123+
try {
124+
const { exitCode } = await testBin(
125+
false,
126+
resolve(__dirname, '../fixtures/promise-config/webpack.config.js')
127+
);
128+
expect(exitCode).toEqual(0);
129+
} catch (err) {
130+
expect(err.stdout.includes('Compiled successfully.')).toBe(true);
131+
}
148132
});
149133

150134
// TODO: hiroppy

0 commit comments

Comments
 (0)