Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
maciekop-l2b committed Apr 25, 2024
1 parent 104e517 commit 8dd6eff
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { MockObject, expect, mockFn, mockObject } from 'earl'
import { expect, mockFn, MockObject, mockObject } from 'earl'

import {
ElasticSearchBackend,
ElasticSearchBackendOptions,
Expand Down Expand Up @@ -34,6 +35,7 @@ describe(ElasticSearchBackend.name, () => {

it('does nothing if buffer is empty', async () => {
const clientMock = createClienMock(false)
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const backendMock = createBackendMock(clientMock)

// wait for log flush
Expand All @@ -58,7 +60,7 @@ describe(ElasticSearchBackend.name, () => {
})
})

function createClienMock(indextExist: boolean = true) {
function createClienMock(indextExist = true) {
return mockObject<ElasticSearchClient>({
indexExist: mockFn(async (_: string): Promise<boolean> => indextExist),
indexCreate: mockFn(async (_: string): Promise<void> => {}),
Expand All @@ -81,9 +83,7 @@ function createBackendMock(clientMock: MockObject<ElasticSearchClient>) {

function createIndexName() {
const now = new Date()
return `${
indexPrefix ?? 'logs-'
}-${now.getFullYear()}.${now.getMonth()}.${now.getDay()}`
return `${indexPrefix}-${now.getFullYear()}.${now.getMonth()}.${now.getDay()}`
}

async function delay(ms: number) {
Expand Down

0 comments on commit 8dd6eff

Please sign in to comment.