fix(tests): make frontend tests compatible with current frontend setup

This commit is contained in:
Kasper Seweryn 2023-05-06 12:25:33 +02:00 committed by jo
commit ed4b923b1e
No known key found for this signature in database
GPG key ID: B2FEC9B22722B984
6 changed files with 129 additions and 22 deletions

View file

@ -0,0 +1,9 @@
import { AudioContext } from 'standardized-audio-context-mock'
import { vi, beforeAll } from 'vitest'
beforeAll(() => {
vi.mock('standardized-audio-context', () => ({
AudioContext
}))
})

View 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)