Skip to content

Commit 360373d

Browse files
authored
Merge pull request #15563 from cool-little-fish/fix-12408
fix: hmr module.check api when called with false
2 parents b9b73c5 + 07242be commit 360373d

3 files changed

Lines changed: 24 additions & 0 deletions

File tree

test/hotCases/status/check/file.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export var value = 1;
2+
---
3+
export var value = 2;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { value } from "./file";
2+
3+
it("call module.check api with false should return updatedModules correctly", function (done) {
4+
expect(value).toBe(1);
5+
NEXT(require("./update")(done));
6+
});
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module.exports = function (done) {
2+
return function (err, stats) {
3+
if (err) return done(err);
4+
module.hot
5+
.check(false)
6+
.then(updatedModules => {
7+
if (!updatedModules) return done(new Error("No update available"));
8+
expect(updatedModules).toContain("./file.js");
9+
done();
10+
})
11+
.catch(err => {
12+
done(err);
13+
});
14+
};
15+
};

0 commit comments

Comments
 (0)