Skip to content

Commit

Permalink
fix(server): change clientLogLevel order to be called first
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroppy committed Jun 5, 2019
1 parent 9582418 commit fcf85c2
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
9 changes: 5 additions & 4 deletions lib/Server.js
Expand Up @@ -694,10 +694,15 @@ class Server {
}
});

if (this.clientLogLevel) {
this.sockWrite([connection], 'log-level', this.clientLogLevel);
}

if (this.hot) {
this.sockWrite([connection], 'hot');
}

// TODO: change condition at major version
if (this.options.liveReload !== false) {
this.sockWrite([connection], 'liveReload', this.options.liveReload);
}
Expand All @@ -710,10 +715,6 @@ class Server {
this.sockWrite([connection], 'overlay', this.clientOverlay);
}

if (this.clientLogLevel) {
this.sockWrite([connection], 'log-level', this.clientLogLevel);
}

if (!this._stats) {
return;
}
Expand Down
6 changes: 6 additions & 0 deletions test/e2e/ClientOptions.test.js
Expand Up @@ -250,6 +250,12 @@ describe('Client console.log', () => {
liveReload: true,
},
},
{
title: 'clientLogLevel is silent',
options: {
clientLogLevel: 'silent',
},
},
];

for (const { title, options } of cases) {
Expand Down
6 changes: 6 additions & 0 deletions test/e2e/__snapshots__/ClientOptions.test.js.snap
@@ -1,5 +1,11 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Client console.log clientLogLevel is silent 1`] = `
Array [
"Hey.",
]
`;

exports[`Client console.log hot disabled 1`] = `
Array [
"Hey.",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fcf85c2

Please sign in to comment.