import { test } from '@japa/runner'
import { CoreEngine, IHttpRequest } from '../../../../src/index.js'

test.group('Logger', (group) => {
  let request: IHttpRequest

  group.each.setup(() => {
    request = {
      url: 'https://domain.com',
      method: 'GET',
    }
  })

  test('Sets default logger', ({ assert }) => {
    const base = new CoreEngine(request)
    const result = base.setupLogger({})
    assert.typeOf(result, 'object')
    assert.typeOf(result.info, 'function')
    assert.typeOf(result.log, 'function')
    assert.typeOf(result.warn, 'function')
    assert.typeOf(result.error, 'function')
  })
})
