Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ node_modules
.eslintcache

test/fixtures/reload-config/main.css
!/test/fixtures/contentbase-config/public/node_modules
9 changes: 5 additions & 4 deletions lib/Server.js
Original file line number Diff line number Diff line change
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
9 changes: 7 additions & 2 deletions test/ContentBase.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,18 @@ describe('ContentBase', () => {
'node_modules',
'index.html'
);
fs.writeFileSync(filePath, 'foo', 'utf8');

// chokidar emitted a change,
// meaning it watched the file correctly
server.contentBaseWatchers[0].on('change', () => done());
server.contentBaseWatchers[0].on('change', () => {
fs.unlinkSync(filePath);
done();
});

// change a file manually
setTimeout(() => {
fs.writeFileSync(filePath, `${Math.random()}`, 'utf8');
fs.writeFileSync(filePath, 'bar', 'utf8');
}, 1000);
});
});
Expand Down
6 changes: 6 additions & 0 deletions test/e2e/ClientOptions.test.js
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Empty file.

This file was deleted.