Skip to content

Commit 7a20ccd

Browse files
committed
Add simple test for lazy mode.
Ref #121
1 parent 52d5609 commit 7a20ccd

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/Server.test.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,27 @@ describe("Server", function() {
8888
});
8989
});
9090

91+
describe("lazy mode", function() {
92+
before(function(done) {
93+
app = express();
94+
var compiler = webpack(webpackConfig);
95+
app.use(middleware(compiler, {
96+
stats: "errors-only",
97+
quiet: true,
98+
lazy: true,
99+
publicPath: "/",
100+
}));
101+
listen = listenShorthand(done);
102+
});
103+
after(close);
104+
105+
it("GET request to bundle file", function(done) {
106+
request(app).get("/bundle.js")
107+
.expect("Content-Length", "2780")
108+
.expect(200, /console\.log\("Hey\."\)/, done);
109+
});
110+
});
111+
91112
describe("custom headers", function() {
92113
before(function(done) {
93114
app = express();

0 commit comments

Comments
 (0)