Skip to content

Commit

Permalink
Improve error reporting while recompilation in HotCases
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Aug 3, 2018
1 parent f5be9a6 commit 795cc35
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions test/HotTestCases.test.js
Expand Up @@ -109,7 +109,7 @@ describe("HotTestCases", () => {
function _next(callback) {
fakeUpdateLoaderOptions.updateIndex++;
compiler.run((err, stats) => {
if (err) return done(err);
if (err) return callback(err);
const jsonStats = stats.toJson({
errorDetails: true
});
Expand All @@ -120,7 +120,7 @@ describe("HotTestCases", () => {
"error",
"errors" + fakeUpdateLoaderOptions.updateIndex,
"Error",
done
callback
)
) {
return;
Expand All @@ -132,12 +132,12 @@ describe("HotTestCases", () => {
"warning",
"warnings" + fakeUpdateLoaderOptions.updateIndex,
"Warning",
done
callback
)
) {
return;
}
if (callback) callback(jsonStats);
callback(null, jsonStats);
});
}

Expand Down
5 changes: 3 additions & 2 deletions test/hotCases/update.js
@@ -1,7 +1,8 @@
module.exports = function(done, options, callback) {
return function(stats) {
return function(err, stats) {
if (err) return done(err);
module.hot.check(options || true).then(() => {
if(callback)
if (callback)
callback(stats);
}).catch((err) => {
done(err);
Expand Down

0 comments on commit 795cc35

Please sign in to comment.