Skip to content

Commit

Permalink
test: update expects based on new log (for logger initialised)
Browse files Browse the repository at this point in the history
  • Loading branch information
meenahoda committed Nov 30, 2021
1 parent 5f74aa5 commit d99d2e8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/logger-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ function readLogFile (filepath) {
}

function expectAllLevels (logs) {
logs.shift()
const levels = logs.map(l => l.level)

const notLogged = Object.values(LEVEL_MAP).filter(l => !levels.includes(l))
Expand Down Expand Up @@ -60,6 +61,7 @@ function expectAllLevels (logs) {
}

function expectSomeLevels (logs, expectedLevels) {
logs.shift()
const levels = logs.map(l => l.level)

for (const [key, value] of Object.keys(LEVEL_MAP)) {
Expand Down Expand Up @@ -117,7 +119,7 @@ describe('Logger tests', function () {
it('check output file contents', () => {
const filepath = bootedServices.logger.loggerOutputFilePath
const logs = readLogFile(filepath)
expect(logs.length).to.eql(6)
expect(logs.length).to.eql(7)
expectAllLevels(logs)
})

Expand Down Expand Up @@ -148,7 +150,7 @@ describe('Logger tests', function () {
it('check output file contents', () => {
const filepath = bootedServices.logger.loggerOutputFilePath
const logs = readLogFile(filepath)
expect(logs.length).to.eql(4)
expect(logs.length).to.eql(5)
expectSomeLevels(logs, ['info', 'warn', 'error', 'fatal'])
})

Expand Down Expand Up @@ -210,7 +212,7 @@ describe('Logger tests', function () {
it('check output file contents', () => {
const filepath = bootedServices.logger.loggerOutputFilePath
const logs = readLogFile(filepath)
expect(logs.length).to.eql(6)
expect(logs.length).to.eql(7)
expectAllLevels(logs)
})

Expand Down

0 comments on commit d99d2e8

Please sign in to comment.