mirror of
https://github.com/gotson/komga.git
synced 2026-05-08 12:35:30 +02:00
fix vitest warning
This commit is contained in:
parent
ef8c4072b4
commit
bc9228f73a
1 changed files with 15 additions and 17 deletions
|
|
@ -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<string, Record<string, string>>,
|
||||
}
|
||||
})
|
||||
})
|
||||
// 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<string, Record<string, string>>,
|
||||
}
|
||||
})
|
||||
|
||||
describe('locale', () => {
|
||||
afterEach(() => {
|
||||
localStorage.clear()
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue