webpack/test/hotCases/code-generation/this-in-accept/index.js

16 lines
380 B
JavaScript
Raw Normal View History

2019-02-21 16:18:59 +08:00
import x from "./module";
it("should have correct this context in accept handler", (done) => {
expect(x).toEqual("ok1");
(function() {
module.hot.accept("./module", () => {
expect(x).toEqual("ok2");
expect(this).toEqual({ ok: true });
done();
});
}).call({ ok: true });
NEXT(require("../../update")(done));
});