Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: hmr module.check api when called with false #15563

Merged
merged 3 commits into from
Apr 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions test/hotCases/status/check/file.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export var value = 1;
---
export var value = 2;
6 changes: 6 additions & 0 deletions test/hotCases/status/check/index.js
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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);
});
};
};