Skip to content

Commit 8f41224

Browse files
committed
resolving review requests from #186
1 parent 42c2e5d commit 8f41224

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

lib/Shared.js

100755100644
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ module.exports = function Shared(context) {
5454
}
5555
}
5656
if(!options.noInfo && !options.quiet) {
57+
var msg = "Compiled successfully.";
5758
if(stats.hasErrors()) {
58-
options.error("webpack: Failed to compile.");
59-
} else if(stats.hasWarnings()) {
60-
options.warn("webpack: Compiled with warnings.");
61-
} else {
62-
options.log("webpack: Compiled successfully.");
63-
}
59+
msg = "Failed to compile.";
60+
} else if(stats.hasWarnings()) {
61+
msg = "Compiled with warnings.";
62+
}
63+
options.log("webpack: " + msg);
6464
}
6565
} else {
6666
options.log("webpack: Compiling...");

test/Reporter.test.js

100755100644
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ describe("Reporter", function() {
7171

7272
plugins.done(errorStats);
7373
setTimeout(function() {
74-
should.strictEqual(console.log.callCount, 0);
74+
should.strictEqual(console.log.callCount, 1);
7575
should.strictEqual(console.warn.callCount, 0);
76-
should.strictEqual(console.error.callCount, 2);
77-
should.strictEqual(console.error.calledWith("webpack: Failed to compile."), true);
76+
should.strictEqual(console.error.callCount, 1);
77+
should.strictEqual(console.log.calledWith("webpack: Failed to compile."), true);
7878
done();
7979
});
8080
});
@@ -84,10 +84,10 @@ describe("Reporter", function() {
8484

8585
plugins.done(warningStats);
8686
setTimeout(function() {
87-
should.strictEqual(console.log.callCount, 0);
88-
should.strictEqual(console.warn.callCount, 2);
87+
should.strictEqual(console.log.callCount, 1);
88+
should.strictEqual(console.warn.callCount, 1);
8989
should.strictEqual(console.error.callCount, 0);
90-
should.strictEqual(console.warn.calledWith("webpack: Compiled with warnings."), true);
90+
should.strictEqual(console.log.calledWith("webpack: Compiled with warnings."), true);
9191
done();
9292
});
9393
});

0 commit comments

Comments
 (0)