-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes bug were the tests would never be run
- Loading branch information
Showing
3 changed files
with
40 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,42 @@ | ||
module.exports = function handleWebpackResult(err, stats) { | ||
if (stats) { | ||
stats = stats.toJson(); | ||
} | ||
var nonFatalErrors = (stats && stats.errors) || []; | ||
var warnings = (stats && stats.warnings) || []; | ||
if (err || nonFatalErrors.length > 0 || warnings.length > 0) { | ||
console.error("Something went wrong while generating the test file"); | ||
if (err) { | ||
console.log("Fatal error:"); | ||
console.log(" ", err); | ||
module.exports = function createHandleWebpackResult(cb) { | ||
return function handleWebpackResult(err, stats) { | ||
if (stats) { | ||
stats = stats.toJson(); | ||
} | ||
if (nonFatalErrors.length > 0) { | ||
console.log("Non-fatal error" + (nonFatalErrors.length > 1 ? "s" : "") + ":"); | ||
nonFatalErrors.forEach(function (err) { | ||
err.split("\n").forEach(function (err) { | ||
console.log(" ", err); | ||
}) | ||
}); | ||
} | ||
if (warnings.length > 0) { | ||
console.log("Warning" + (nonFatalErrors.length > 1 ? "s" : "") + ":"); | ||
warnings.forEach(function (err) { | ||
err.split("\n").forEach(function (err) { | ||
console.log(" ", err); | ||
}) | ||
}); | ||
} | ||
if (err) { | ||
console.error("Building failed!"); | ||
var nonFatalErrors = (stats && stats.errors) || []; | ||
var warnings = (stats && stats.warnings) || []; | ||
if (err || nonFatalErrors.length > 0 || warnings.length > 0) { | ||
console.error("Something went wrong while generating the test file"); | ||
if (err) { | ||
console.log("Fatal error:"); | ||
console.log(" ", err); | ||
} | ||
if (nonFatalErrors.length > 0) { | ||
console.log("Non-fatal error" + (nonFatalErrors.length > 1 ? "s" : "") + ":"); | ||
nonFatalErrors.forEach(function (err) { | ||
err.split("\n").forEach(function (err) { | ||
console.log(" ", err); | ||
}) | ||
}); | ||
} | ||
if (warnings.length > 0) { | ||
console.log("Warning" + (nonFatalErrors.length > 1 ? "s" : "") + ":"); | ||
warnings.forEach(function (err) { | ||
err.split("\n").forEach(function (err) { | ||
console.log(" ", err); | ||
}) | ||
}); | ||
} | ||
if (err) { | ||
console.error("Building failed!"); | ||
cb(false); | ||
} else { | ||
console.error("Building finished, but the result might not work!"); | ||
cb(true); | ||
} | ||
} else { | ||
console.error("Building finished, but the result might not work!"); | ||
console.log("Building succeeded!"); | ||
cb(true); | ||
} | ||
} else { | ||
console.log("Building succeeded!"); | ||
} | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters