Skip to content

Commit f9b4753

Browse files
committed
Removed LoggerProxy
1 parent ff8a623 commit f9b4753

File tree

4 files changed

+6
-29
lines changed

4 files changed

+6
-29
lines changed

node_helper.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ const { JSDOM } = require('jsdom');
1010

1111
const HtmlFetcher = require('./src/HtmlFetcher');
1212
const HtmlParser = require('./src/HtmlParser');
13-
const Log = require('./src/LoggerProxy');
1413

1514
module.exports = NodeHelper.create({
1615
htmlFetcher: null,
1716
htmlParser: null,
1817

19-
start: function (htmlFetcher, htmlParser) {
18+
start: function (htmlFetcher, htmlParser, logger) {
2019
this.htmlFetcher = htmlFetcher || new HtmlFetcher();
2120
this.htmlParser = htmlParser || new HtmlParser(JSDOM);
21+
this.logger = logger || require('logger');
2222
},
2323

2424
socketNotificationReceived: async function (notification, payload) {
25-
Log.log(`Received socket notification ${notification}.`);
25+
this.logger.log(`Received socket notification ${notification}.`);
2626

2727
if (notification === 'LOAD_EVENTS') {
2828
// Load data
@@ -34,7 +34,7 @@ module.exports = NodeHelper.create({
3434
},
3535

3636
loadEvents: async function (language) {
37-
Log.log('Load events ...');
37+
this.logger.log('Load events ...');
3838

3939
// Get HTML
4040
const html = await this.htmlFetcher.fetch(language);

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
"exclude": [
3838
"coverage",
3939
"test",
40-
"src/LoggerProxy.js",
4140
"src/WikiCssSelectors.js"
4241
],
4342
"cache": true,

src/LoggerProxy.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

test/env/HelperTestEnv.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,19 @@ const htmlFetcherMock = {
2626
},
2727
};
2828

29-
// Mock proxy logger
30-
const LoggerProxyFake = {
29+
const loggerMock = {
3130
log: function () {},
3231
};
3332

3433
// Load helper definition
3534
const nodeHelperDefinition = proxyquire('../../node_helper', {
3635
node_helper: NodeHelperFake,
37-
'./src/LoggerProxy': LoggerProxyFake,
3836
});
3937

4038
module.exports = function () {
4139
const nodeHelper = Object.assign({}, nodeHelperDefinition);
4240

43-
nodeHelper.start(htmlFetcherMock);
41+
nodeHelper.start(htmlFetcherMock, null, loggerMock);
4442

4543
// Fake inherited methods
4644
nodeHelper.sendSocketNotification = sinon.fake();

0 commit comments

Comments
 (0)