From bc9228f73a76c293103c8cf068dc6588af406007 Mon Sep 17 00:00:00 2001 From: Gauthier Roebroeck Date: Fri, 27 Mar 2026 16:36:10 +0800 Subject: [PATCH] fix vitest warning --- next-ui/src/utils/i18n/locale-helper.test.ts | 32 +++++++++----------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/next-ui/src/utils/i18n/locale-helper.test.ts b/next-ui/src/utils/i18n/locale-helper.test.ts index 9165452a..c3d04ae2 100644 --- a/next-ui/src/utils/i18n/locale-helper.test.ts +++ b/next-ui/src/utils/i18n/locale-helper.test.ts @@ -1,23 +1,21 @@ -import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest' +import { afterEach, describe, expect, test, vi } from 'vitest' import { loadLocale, fallbackLocale, setLocale, getLocale, availableLocales } from './locale-helper' -describe('locale', () => { - beforeEach(() => { - // mock the available locales, as locales are checked against what's available - vi.mock('@/i18n?dir2json&ext=.json&1', () => { - return { - default: { - en: { - sample: 'sample', - }, - fr: { - sample: 'échantillon', - }, - } as Record>, - } - }) - }) +// mock the available locales, as locales are checked against what's available +vi.mock('@/i18n?dir2json&ext=.json&1', () => { + return { + default: { + en: { + sample: 'sample', + }, + fr: { + sample: 'échantillon', + }, + } as Record>, + } +}) +describe('locale', () => { afterEach(() => { localStorage.clear() })