2020-04-25 06:28:27 +08:00
|
|
|
import vendor from "vendor";
|
2020-06-22 23:49:57 +08:00
|
|
|
import.meta.hot.accept("vendor");
|
|
|
|
it("should hot update a splitted initial chunk using import.meta.hot.* API", function (done) {
|
2020-04-25 06:28:27 +08:00
|
|
|
expect(vendor).toBe("1");
|
|
|
|
NEXT(
|
|
|
|
require("../../update")(done, true, () => {
|
|
|
|
expect(vendor).toBe("2");
|
|
|
|
done();
|
|
|
|
})
|
|
|
|
);
|
|
|
|
});
|
2020-06-22 23:49:57 +08:00
|
|
|
|
|
|
|
it("should hot update a splitted initial chunk using module.hot.* API", function (done) {
|
|
|
|
expect(vendor).toBe("2");
|
|
|
|
module.hot.accept("vendor");
|
|
|
|
NEXT(
|
|
|
|
require("../../update")(done, true, () => {
|
|
|
|
expect(vendor).toBe("3");
|
|
|
|
done();
|
|
|
|
})
|
|
|
|
);
|
|
|
|
});
|