2017-03-22 19:09:22 +08:00
|
|
|
it("should combine two chunk if too small", done => {
|
|
|
|
|
// b should not yet available
|
|
|
|
|
var bf = __webpack_modules__[require.resolveWeak("./b")];
|
2018-01-27 05:51:03 +08:00
|
|
|
expect((typeof bf)).toBe("undefined");
|
2017-03-22 19:09:22 +08:00
|
|
|
|
|
|
|
|
// load a
|
|
|
|
|
import("./a").then(a => {
|
2018-01-27 05:51:03 +08:00
|
|
|
expect(a.default).toBe("a");
|
2017-03-22 19:09:22 +08:00
|
|
|
// check if b is available too
|
|
|
|
|
var bf = __webpack_modules__[require.resolveWeak("./b")];
|
2018-01-27 05:51:03 +08:00
|
|
|
expect((typeof bf)).toBe("function");
|
2017-03-22 19:09:22 +08:00
|
|
|
|
|
|
|
|
// load b (just to check if it's ok)
|
|
|
|
|
import("./b").then(b => {
|
2018-01-27 05:51:03 +08:00
|
|
|
expect(b.default).toBe("b");
|
2017-03-22 19:09:22 +08:00
|
|
|
done();
|
|
|
|
|
}).catch(done);
|
|
|
|
|
}).catch(done);
|
|
|
|
|
});
|