From e32411eaaa2bee65fbfae2a76b6875bfd335a542 Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Thu, 30 Jul 2020 15:23:04 +0100 Subject: [PATCH] Clean up acceptance tests --- libraries/logger/logging-manager.js | 4 ---- .../logger/test/unit/loggingManagerTests.js | 24 +++++++------------ 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/libraries/logger/logging-manager.js b/libraries/logger/logging-manager.js index a4b4caeaa7..20156ec417 100644 --- a/libraries/logger/logging-manager.js +++ b/libraries/logger/logging-manager.js @@ -22,7 +22,6 @@ const errSerializer = function (err) { const Logger = (module.exports = { initialize(name) { - console.log('IN INIT') this.logLevelSource = (process.env.LOG_LEVEL_SOURCE || 'file').toLowerCase() this.isProduction = (process.env.NODE_ENV || '').toLowerCase() === 'production' @@ -40,7 +39,6 @@ const Logger = (module.exports = { }) this._setupRingBuffer() this._setupStackdriver() - console.log(this.logger) this._setupLogLevelChecker() return this }, @@ -256,8 +254,6 @@ const Logger = (module.exports = { }, _setupLogLevelChecker() { - console.log('In _setupLogLevelChecker') - console.log(this.logger) if (this.isProduction) { // clear interval if already set if (this.checkInterval) { diff --git a/libraries/logger/test/unit/loggingManagerTests.js b/libraries/logger/test/unit/loggingManagerTests.js index d0de9ad64b..23438a673a 100644 --- a/libraries/logger/test/unit/loggingManagerTests.js +++ b/libraries/logger/test/unit/loggingManagerTests.js @@ -111,21 +111,13 @@ describe('LoggingManager', function () { afterEach(() => delete process.env.NODE_ENV) - describe('blah', function () { - beforeEach(function () { - this.logger = this.LoggingManager.initialize(this.loggerName) - }) - it('should default to log level warn', function () { - - const level = this.Bunyan.createLogger.firstCall.args[0].streams[0].level - console.log(level) - level.should.equal( - 'warn' - ) - }) - }) - - + it('should default to log level warn', function () { + this.logger = this.LoggingManager.initialize(this.loggerName) + this.Bunyan.createLogger.firstCall.args[0].streams[0].level.should.equal( + 'warn' + ) + }) + describe('logLevelSource file', function () { beforeEach(function() { this.logger = this.LoggingManager.initialize(this.loggerName) @@ -324,7 +316,7 @@ describe('LoggingManager', function () { describe('when read errors', function () { beforeEach(async function () { - this.Fs.promises.readFile.yields(new Error('error')) + this.Fs.promises.readFile.throws(new Error('error')) this.logger.getTracingEndTime = this.logger.getTracingEndTimeFile await this.logger.checkLogLevel() })