Skip to content

Commit

Permalink
Merge pull request #15563 from cool-little-fish/fix-12408
Browse files Browse the repository at this point in the history
fix: hmr module.check api when called with false
  • Loading branch information
sokra committed Apr 7, 2022
2 parents b9b73c5 + 07242be commit 360373d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/hotCases/status/check/file.js
@@ -0,0 +1,3 @@
export var value = 1;
---
export var value = 2;
6 changes: 6 additions & 0 deletions test/hotCases/status/check/index.js
@@ -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));
});
15 changes: 15 additions & 0 deletions test/hotCases/status/check/update.js
@@ -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);
});
};
};

0 comments on commit 360373d

Please sign in to comment.