Skip to content

Commit 5c8fa5b

Browse files
test(e2e): warnings and errors (#3441)
1 parent 809631c commit 5c8fa5b

File tree

6 files changed

+705
-78
lines changed

6 files changed

+705
-78
lines changed

client-src/index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ const socketURL = createSocketURL(parsedResourceQuery);
5151

5252
function setAllLogLevel(level) {
5353
// This is needed because the HMR logger operate separately from dev server logger
54-
webpackHotLog.setLogLevel(level);
54+
webpackHotLog.setLogLevel(
55+
level === 'verbose' || level === 'log' ? 'info' : level
56+
);
5557
setLogLevel(level);
5658
}
5759

lib/Server.js

+10-6
Original file line numberDiff line numberDiff line change
@@ -977,10 +977,14 @@ class Server {
977977

978978
this.sendMessage(sockets, 'hash', stats.hash);
979979

980-
if (stats.errors.length > 0) {
981-
this.sendMessage(sockets, 'errors', stats.errors);
982-
} else if (stats.warnings.length > 0) {
983-
this.sendMessage(sockets, 'warnings', stats.warnings);
980+
if (stats.errors.length > 0 || stats.warnings.length > 0) {
981+
if (stats.errors.length > 0) {
982+
this.sendMessage(sockets, 'errors', stats.errors);
983+
}
984+
985+
if (stats.warnings.length > 0) {
986+
this.sendMessage(sockets, 'warnings', stats.warnings);
987+
}
984988
} else {
985989
this.sendMessage(sockets, 'ok');
986990
}
@@ -1022,8 +1026,8 @@ class Server {
10221026

10231027
// disabling refreshing on changing the content
10241028
if (this.options.liveReload) {
1025-
watcher.on('change', () => {
1026-
this.sendMessage(this.sockets, 'static-changed', watchPath);
1029+
watcher.on('change', (item) => {
1030+
this.sendMessage(this.sockets, 'static-changed', item);
10271031
});
10281032
}
10291033

0 commit comments

Comments
 (0)