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

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

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;

test/hotCases/status/check/index.js

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+
});

test/hotCases/status/check/update.js

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy