-
-
Notifications
You must be signed in to change notification settings - Fork 624
/
Copy pathwebpack.test.js
79 lines (61 loc) · 2 KB
/
webpack.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
"use strict";
const { runTest, runTestStdout } = require("../helpers");
const noCommand = () => {
const packageName = "webpack";
const args = [];
const logMessage = "For using 'build' command you need to install: 'webpack' package.";
return runTest(packageName, args, logMessage);
};
const buildCommand = () => {
const packageName = "webpack";
const args = ["build"];
const logMessage = "For using 'build' command you need to install: 'webpack' package.";
return runTest(packageName, args, logMessage);
};
const watchCommand = () => {
const packageName = "webpack";
const args = ["watch"];
const logMessage = "For using 'watch' command you need to install: 'webpack' package.";
return runTest(packageName, args, logMessage);
};
const serveCommand = () => {
const packageName = "webpack";
const args = ["serve"];
const logMessage = "For using 'serve' command you need to install: 'webpack' package.";
return runTest(packageName, args, logMessage);
};
const versionCommand = () => {
const packageName = "webpack";
const args = ["version"];
const logMessage = "System:";
return runTestStdout({ packageName, cliArgs: args, logMessage });
};
const helpCommand = () => {
const packageName = "webpack";
const args = ["help"];
const logMessage = "The build tool for modern web applications.";
return runTestStdout({ packageName, cliArgs: args, logMessage });
};
const infoCommand = () => {
const packageName = "webpack";
const args = ["info"];
const logMessage = "System:";
return runTestStdout({ packageName, cliArgs: args, logMessage });
};
const configtestCommand = () => {
const packageName = "webpack";
const args = ["configtest"];
const logMessage = "For using 'configtest' command you need to install: 'webpack' package.";
return runTest(packageName, args, logMessage);
};
module.exports.run = [
noCommand,
buildCommand,
watchCommand,
serveCommand,
configtestCommand,
versionCommand,
infoCommand,
helpCommand,
];
module.exports.name = "Missing webpack";