Skip to content

Commit 591ae97

Browse files
committed
Add basic tests for lazy mode
Ref #623
1 parent 98a2ba9 commit 591ae97

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"mocha": "^3.0.2",
3333
"pug": "^2.0.0-beta5",
3434
"pug-loader": "^2.3.0",
35+
"should": "^11.1.0",
3536
"style-loader": "~0.13.0",
3637
"supertest": "^2.0.0",
3738
"url-loader": "~0.5.6",

test/Lazy.test.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
var should = require("should");
2+
var helper = require("./helper");
3+
var config = require("./fixtures/simple-config/webpack.config");
4+
5+
describe("Lazy", function() {
6+
afterEach(helper.close);
7+
8+
it("without filename option it should throw an error", function() {
9+
should.throws(function() {
10+
helper.start(config, {
11+
lazy: true
12+
});
13+
}, /'filename' option must be set/);
14+
});
15+
16+
it("with filename option should not throw an error", function(done) {
17+
helper.start(config, {
18+
lazy: true,
19+
filename: "bundle.js"
20+
}, done);
21+
});
22+
});

0 commit comments

Comments
 (0)