Merge pull request #15563 from cool-little-fish/fix-12408
fix: hmr module.check api when called with false
This commit is contained in:
commit
360373d76e
|
@ -0,0 +1,3 @@
|
|||
export var value = 1;
|
||||
---
|
||||
export var value = 2;
|
|
@ -0,0 +1,6 @@
|
|||
import { value } from "./file";
|
||||
|
||||
it("call module.check api with false should return updatedModules correctly", function (done) {
|
||||
expect(value).toBe(1);
|
||||
NEXT(require("./update")(done));
|
||||
});
|
|
@ -0,0 +1,15 @@
|
|||
module.exports = function (done) {
|
||||
return function (err, stats) {
|
||||
if (err) return done(err);
|
||||
module.hot
|
||||
.check(false)
|
||||
.then(updatedModules => {
|
||||
if (!updatedModules) return done(new Error("No update available"));
|
||||
expect(updatedModules).toContain("./file.js");
|
||||
done();
|
||||
})
|
||||
.catch(err => {
|
||||
done(err);
|
||||
});
|
||||
};
|
||||
};
|
Loading…
Reference in New Issue