mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01:00
Clean up acceptance tests
This commit is contained in:
@@ -22,7 +22,6 @@ const errSerializer = function (err) {
|
|||||||
|
|
||||||
const Logger = (module.exports = {
|
const Logger = (module.exports = {
|
||||||
initialize(name) {
|
initialize(name) {
|
||||||
console.log('IN INIT')
|
|
||||||
this.logLevelSource = (process.env.LOG_LEVEL_SOURCE || 'file').toLowerCase()
|
this.logLevelSource = (process.env.LOG_LEVEL_SOURCE || 'file').toLowerCase()
|
||||||
this.isProduction =
|
this.isProduction =
|
||||||
(process.env.NODE_ENV || '').toLowerCase() === 'production'
|
(process.env.NODE_ENV || '').toLowerCase() === 'production'
|
||||||
@@ -40,7 +39,6 @@ const Logger = (module.exports = {
|
|||||||
})
|
})
|
||||||
this._setupRingBuffer()
|
this._setupRingBuffer()
|
||||||
this._setupStackdriver()
|
this._setupStackdriver()
|
||||||
console.log(this.logger)
|
|
||||||
this._setupLogLevelChecker()
|
this._setupLogLevelChecker()
|
||||||
return this
|
return this
|
||||||
},
|
},
|
||||||
@@ -256,8 +254,6 @@ const Logger = (module.exports = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_setupLogLevelChecker() {
|
_setupLogLevelChecker() {
|
||||||
console.log('In _setupLogLevelChecker')
|
|
||||||
console.log(this.logger)
|
|
||||||
if (this.isProduction) {
|
if (this.isProduction) {
|
||||||
// clear interval if already set
|
// clear interval if already set
|
||||||
if (this.checkInterval) {
|
if (this.checkInterval) {
|
||||||
|
|||||||
@@ -111,21 +111,13 @@ describe('LoggingManager', function () {
|
|||||||
|
|
||||||
afterEach(() => delete process.env.NODE_ENV)
|
afterEach(() => delete process.env.NODE_ENV)
|
||||||
|
|
||||||
describe('blah', function () {
|
it('should default to log level warn', function () {
|
||||||
beforeEach(function () {
|
this.logger = this.LoggingManager.initialize(this.loggerName)
|
||||||
this.logger = this.LoggingManager.initialize(this.loggerName)
|
this.Bunyan.createLogger.firstCall.args[0].streams[0].level.should.equal(
|
||||||
})
|
'warn'
|
||||||
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'
|
|
||||||
)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
describe('logLevelSource file', function () {
|
describe('logLevelSource file', function () {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
this.logger = this.LoggingManager.initialize(this.loggerName)
|
this.logger = this.LoggingManager.initialize(this.loggerName)
|
||||||
@@ -324,7 +316,7 @@ describe('LoggingManager', function () {
|
|||||||
|
|
||||||
describe('when read errors', function () {
|
describe('when read errors', function () {
|
||||||
beforeEach(async 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
|
this.logger.getTracingEndTime = this.logger.getTracingEndTimeFile
|
||||||
await this.logger.checkLogLevel()
|
await this.logger.checkLogLevel()
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user