fix error for Example test cases

This commit is contained in:
Tobias Koppers 2019-11-10 20:57:14 +01:00
parent 5abf55b1af
commit f2e1c04372
1 changed files with 11 additions and 5 deletions

View File

@ -41,11 +41,17 @@ describe("Examples", () => {
}
webpack(options, (err, stats) => {
if (err) return done(err);
stats = stats.toJson({
errorDetails: true
});
if (stats.errors.length > 0) {
return done(new Error(stats.errors[0]));
if (stats.hasErrors()) {
return done(
new Error(
stats.toString({
all: false,
errors: true,
errorDetails: true,
errorStacks: true
})
)
);
}
done();
});