Skip to content

Commit fd0a0f3

Browse files
committed
Use sinon stub in place of logger
1 parent 8ab7d0b commit fd0a0f3

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

tests/lib/services/dgg-rolling-chat-cache.test.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
const assert = require('assert');
22
const sinon = require('sinon');
33
const RollingChatCache = require('../../../lib/services/dgg-rolling-chat-cache');
4-
const config = require('../../../lib/configuration/prod.config.json');
5-
const logger = require('../../../lib/services/logger');
64
const messageMatchingService = require('../../../lib/services/message-matching');
5+
const Logger = require('bunyan');
76

87
describe('Chat Cache Test suite', () => {
98
describe('Chat Cache Viewer Map Tests', () => {
109
beforeEach(() => {
1110
this.mockServices = {
12-
logger: logger(config.logger),
11+
logger: sinon.createStubInstance(Logger),
1312
messageMatching: messageMatchingService,
1413
};
1514
});
@@ -101,7 +100,7 @@ describe('Chat Cache Test suite', () => {
101100
describe('Chat Cache Tombstoning Tests', () => {
102101
beforeEach(function () {
103102
this.mockServices = {
104-
logger: logger(config.logger),
103+
logger: sinon.createStubInstance(Logger),
105104
messageMatching: messageMatchingService,
106105
};
107106
this.clock = sinon.useFakeTimers();
@@ -160,7 +159,7 @@ describe('Chat Cache Test suite', () => {
160159
describe('Chat Cache Rate Limit Tests', () => {
161160
beforeEach(function () {
162161
this.mockServices = {
163-
logger: logger(config.logger),
162+
logger: sinon.createStubInstance(Logger),
164163
messageMatching: messageMatchingService,
165164
};
166165
this.clock = sinon.useFakeTimers();
@@ -204,7 +203,7 @@ describe('Chat Cache Test suite', () => {
204203
describe('Chat Cache Running List', () => {
205204
beforeEach(function () {
206205
this.mockServices = {
207-
logger: logger(config.logger),
206+
logger: sinon.createStubInstance(Logger),
208207
messageMatching: messageMatchingService,
209208
};
210209
this.clock = sinon.useFakeTimers();

tests/lib/services/spam-detection.test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
const assert = require('assert');
2+
const sinon = require('sinon');
23
const RollingChatCache = require('../../../lib/services/dgg-rolling-chat-cache');
34
const SpamDetection = require('../../../lib/services/spam-detection');
4-
const config = require('../../../lib/configuration/prod.config.json');
5-
const logger = require('../../../lib/services/logger');
65
const messageMatchingService = require('../../../lib/services/message-matching');
6+
const Logger = require('bunyan');
77

88
describe('Spam detection Tests', () => {
99
beforeEach(function() {
1010
this.mockServices = {
11-
logger: logger(config.logger),
11+
logger: sinon.createStubInstance(Logger),
1212
messageMatching: messageMatchingService,
1313
};
1414
this.spamDetection = new SpamDetection({}, this.mockServices);

0 commit comments

Comments
 (0)