From 7957661573818919c71221f5c396bcf27c5e8e03 Mon Sep 17 00:00:00 2001 From: wvffle Date: Tue, 20 Feb 2024 16:39:18 +0000 Subject: [PATCH] style: fix linting errors Part-of: --- front/src/composables/useLogger.ts | 3 ++- front/test/setup/mock-server.ts | 6 ++++-- front/test/specs/composables/audio/tracks.test.ts | 4 +--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/front/src/composables/useLogger.ts b/front/src/composables/useLogger.ts index 116255049..86161d830 100644 --- a/front/src/composables/useLogger.ts +++ b/front/src/composables/useLogger.ts @@ -46,7 +46,8 @@ const FILETYPE_COLOR: Record = { // NOTE: We're pushing all logs to the end of the event loop const createLoggerFn = (level: LogLevel) => { - // @ts-expect-error Use console in test environment + // NOTE: Use console in test environment + // eslint-disable-next-line no-console if (import.meta.env.VITEST) return console[level] // NOTE: Don't log time and debug in production environment diff --git a/front/test/setup/mock-server.ts b/front/test/setup/mock-server.ts index 95b8e65b5..5b9806780 100644 --- a/front/test/setup/mock-server.ts +++ b/front/test/setup/mock-server.ts @@ -4,9 +4,11 @@ import { setupServer } from 'msw/node' import.meta.env.VUE_APP_INSTANCE_URL = 'http://localhost:3000/' const server = setupServer( - // We need to map the urls and remove /api/v1 prefix ...handlers.map((handler) => { - handler.info.path = handler.info.path.replace('/api/v1', '') + if (typeof handler.info.path === 'string') { + handler.info.path = handler.info.path.replace('/api/v1', '') + } + handler.info.header = handler.info.header.replace('/api/v1', '') return handler }) diff --git a/front/test/specs/composables/audio/tracks.test.ts b/front/test/specs/composables/audio/tracks.test.ts index 283828ad9..5663aa7bb 100644 --- a/front/test/specs/composables/audio/tracks.test.ts +++ b/front/test/specs/composables/audio/tracks.test.ts @@ -20,13 +20,11 @@ const createTrack = (() => { return { id: createTrack.id++, uploads: [] } as any as Track }) - beforeAll(() => { const { initialize } = useTracks() initialize() }) - describe('cache', () => { beforeEach(async () => { createTrack.id = 0 @@ -37,7 +35,7 @@ describe('cache', () => { createTrack(), createTrack(), createTrack(), - createTrack(), + createTrack() ) })