-
Notifications
You must be signed in to change notification settings - Fork 19
/
vitest.config.ts
51 lines (48 loc) · 1.47 KB
/
vitest.config.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
50
51
/// <reference types="vitest" />
import { resolve } from 'path'
import * as dotenv from 'dotenv-safe'
import { mergeConfig } from 'vite'
import { defineConfig } from 'vitest/config'
import { viteConfig } from './nuxt.config'
import Vue from '@vitejs/plugin-vue'
// TODO: https://github.com/leaderboardsgg/leaderboard-site/issues/503
const { parsed } = dotenv.config({
example: resolve(__dirname, '.env.example'),
path: resolve(__dirname, '.env.test'),
})
export default mergeConfig(
viteConfig,
defineConfig({
plugins: [
Vue({
template: {
compilerOptions: {
// This is to prevent the following warnings:
// [Vue warn]: Failed to resolve component: NuxtLink
// If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
// at <ButtonLink class="nav-link" name="About" to="#" >
// at <NavLink name="About" to="#" key="About" >
// at <NavLinks>
// at <SiteNavbar ref="VTU_COMPONENT" >
// at <VTUROOT>
isCustomElement: (tag) => tag === 'NuxtLink',
},
},
}),
],
resolve: {
alias: {
'#app': resolve(__dirname, './node_modules/nuxt/dist/app'),
},
},
test: {
environment: 'happy-dom',
env: parsed,
globals: true,
sequence: {
shuffle: true,
},
setupFiles: ['vitest.setup.ts'],
},
}),
)