-
-
Notifications
You must be signed in to change notification settings - Fork 384
/
Copy pathignoreOrder-option.test.js
45 lines (42 loc) · 1.29 KB
/
ignoreOrder-option.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
import path from "path";
import webpack from "webpack";
describe("IgnoreOrder", () => {
it("should emit warnings", (done) => {
const casesDirectory = path.resolve(__dirname, "cases");
const directoryForCase = path.resolve(casesDirectory, "ignoreOrderFalse");
// eslint-disable-next-line import/no-dynamic-require, global-require
const webpackConfig = require(path.resolve(
directoryForCase,
"webpack.config.js"
));
const compiler = webpack({
...webpackConfig,
mode: "development",
context: directoryForCase,
cache: false,
});
compiler.run((err1, stats) => {
expect(stats.hasWarnings()).toBe(true);
done();
});
});
it("should not emit warnings", (done) => {
const casesDirectory = path.resolve(__dirname, "cases");
const directoryForCase = path.resolve(casesDirectory, "ignoreOrder");
// eslint-disable-next-line import/no-dynamic-require, global-require
const webpackConfig = require(path.resolve(
directoryForCase,
"webpack.config.js"
));
const compiler = webpack({
...webpackConfig,
mode: "development",
context: directoryForCase,
cache: false,
});
compiler.run((err1, stats) => {
expect(stats.hasWarnings()).toBe(false);
done();
});
});
});