fix(tests): make frontend tests compatible with current frontend setup
This commit is contained in:
parent
ea0de43ad6
commit
ed4b923b1e
6 changed files with 129 additions and 22 deletions
9
front/test/setup/mock-audio-context.ts
Normal file
9
front/test/setup/mock-audio-context.ts
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import { AudioContext } from 'standardized-audio-context-mock'
|
||||
import { vi, beforeAll } from 'vitest'
|
||||
|
||||
beforeAll(() => {
|
||||
vi.mock('standardized-audio-context', () => ({
|
||||
AudioContext
|
||||
}))
|
||||
})
|
||||
|
||||
14
front/test/setup/mock-vue-i18n.ts
Normal file
14
front/test/setup/mock-vue-i18n.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import { config } from '@vue/test-utils'
|
||||
import { createI18n } from 'vue-i18n'
|
||||
import en from '~/locales/en_US.json'
|
||||
|
||||
const i18n = createI18n({
|
||||
legacy: false,
|
||||
locale: 'en',
|
||||
messages: {
|
||||
en
|
||||
}
|
||||
})
|
||||
|
||||
config.global.plugins ??= []
|
||||
config.global.plugins.push(i18n)
|
||||
Loading…
Add table
Add a link
Reference in a new issue