generated from it-at-m/oss-repository-en-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vitest.setup.ts
49 lines (48 loc) · 1.14 KB
/
vitest.setup.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import { config } from '@vue/test-utils'
import { createTestingPinia } from '@pinia/testing'
import vuetify from './src/plugins/vuetify'
import { I18nOptions, createI18n } from 'vue-i18n'
const datetimeFormats: I18nOptions['datetimeFormats'] = {
// feste Zeitzone für Tests
de: {
// TT.MM.JJJJ
short: {
year: 'numeric',
month: '2-digit',
day: '2-digit',
timeZone: 'UTC'
},
// TT.MM.JJJJ HH24:MM
long: {
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
timeZone: 'UTC'
},
// TT.MM.JJJJ HH24:MM:SS
timestamp: {
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
timeZone: 'UTC'
}
}
}
const i18n = createI18n({
legacy: false,
locale: 'de',
fallbackLocale: 'de',
messages: {
// keine Message Keys in Vitest Tests (sind dort egal)
de: {}
},
datetimeFormats: datetimeFormats
})
config.global.plugins = [vuetify, createTestingPinia(), i18n]
// needed by Vuetify
global.CSS = { supports: () => false, escape: () => '' }