-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdisable-option.spec.js
77 lines (69 loc) · 2.25 KB
/
disable-option.spec.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
describe("Running CssEntryPlugin disabled", () => {
beforeEach(done => {
this.webpack = webpackTestFixture(jasmine)
.withCssEntryPlugin({
disable: true
})
.cleanOutput(done);
});
describe("configured with a shorthand single entry (.css)", () => {
beforeEach(done => {
this.webpack
.config({
entry: fixtures.style1.path
})
.run(done);
});
beforeEach(() => expect(this.webpack).toSucceed());
it("generates a single js bundle", () => {
expect(this.webpack).toOutput({
fileCount: 1,
file: "main.bundle.js",
withContent: fixtures.style1.content
});
});
});
describe("configured with a shorthand single entry (.js)", () => {
beforeEach(done => {
this.webpack
.config({
entry: fixtures.script1.path
})
.run(done);
});
beforeEach(() => expect(this.webpack).toSucceed());
it("generates a single js bundle", () => {
expect(this.webpack).toOutput({
fileCount: 1,
file: "main.bundle.js",
withContent: fixtures.script1.content
});
});
});
describe("configured with multi entry (1: .js, 2: .css)", () => {
beforeEach(done => {
this.webpack
.config({
entry: {
"style": fixtures.style1.path,
"script": fixtures.script1.path
}
})
.run(done);
});
beforeEach(() => expect(this.webpack).toSucceed());
it("generates two js bundles", () => {
expect(this.webpack).toOutput({
fileCount: 2
});
expect(this.webpack).toOutput({
file: "style.bundle.js",
withContent: fixtures.style1.content
});
expect(this.webpack).toOutput({
file: "script.bundle.js",
withContent: fixtures.script1.content
});
});
});
});