const getLoggerWithFields = require('./getLoggerWithFields')


const log = getLoggerWithFields({
  info: (msg, fields) => ({ msg, fields }),
})

  /* eslint-env jest/globals */

describe('log output without any fields defined:', () => {
  const result = log.info('text')

  test('should return the "msg"', () => { expect(result).toHaveProperty('msg', 'text') })
  test('should return an empty "fields"', () => { expect(result).toHaveProperty('fields', {}) })
})

describe('log output with fields defined in the log command:', () => {
  const result = log.info('text', { four: 4 })

  test('should return the "msg"', () => { expect(result).toHaveProperty('msg', 'text') })
  test('should return an empty "fields"', () => { expect(result).toHaveProperty('fields', { four: 4 }) })
})

describe('log output with fields predefined:', () => {
  const result = log.withFields({ five: 5 }).info('text')

  test('should return the "msg"', () => { expect(result).toHaveProperty('msg', 'text') })
  test('should return an empty "fields"', () => { expect(result).toHaveProperty('fields', { five: 5 }) })
})

describe('log output with fields predefined and in the log command:', () => {
  const result = log.withFields({ five: 5 }).info('text', { four: 4 })

  test('should return the "msg"', () => { expect(result).toHaveProperty('msg', 'text') })
  test('should return an empty "fields"', () => { expect(result).toHaveProperty('fields', { five: 5, four: 4 }) })
})

describe('log output with fields predefined and in the log command meta:', () => {
  const result = log.withFields({ f: 5 }).withFields({ t: 3 }).info('text', { d: 4 })

  test('should return the "msg"', () => { expect(result).toHaveProperty('msg', 'text') })
  test('should return an empty "fields"', () => { expect(result).toHaveProperty('fields', { f: 5, t: 3, d: 4 }) })
})

@@ -767,32 +767,335 @@
 ur: 4 %7D) %7D)%0A%7D)%0A%0A
+describe('log output with %22withFields%22 default value:', () =%3E %7B%0A  const result = log.withFields().info('text')%0A%0A  test('should return the %22msg%22', () =%3E %7B expect(result).toHaveProperty('msg', 'text') %7D)%0A  test('should return an empty %22fields%22', () =%3E %7B expect(result).toHaveProperty('fields', %7B%7D) %7D)%0A%7D)%0A%0A
 describe('log ou
@@ -1125,32 +1125,32 @@
 ined:', () =%3E %7B%0A
-
   const result =
@@ -1300,32 +1300,31 @@
 ould return 
-an empty
+correct
  %22fields%22', 
@@ -1312,32 +1312,37 @@
 correct %22fields%22
+ data
 ', () =%3E %7B expec
@@ -1654,32 +1654,31 @@
 ould return 
-an empty
+correct
  %22fields%22', 
@@ -1666,32 +1666,37 @@
 correct %22fields%22
+ data
 ', () =%3E %7B expec

Add test case to make full coverage