-
Notifications
You must be signed in to change notification settings - Fork 97
Expand file tree
/
Copy pathvitest.config.ts
More file actions
42 lines (39 loc) · 1.14 KB
/
vitest.config.ts
File metadata and controls
42 lines (39 loc) · 1.14 KB
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
/**
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import { resolve } from 'node:path'
import { defineConfig } from 'vite'
import viteConfig from './vite.config'
export default async (env) => {
const config = typeof viteConfig === 'function' ? await viteConfig(env) : viteConfig
return defineConfig({
...config,
test: {
// ensure we have a consistent testing environment between local and CI
env: {
// used by Intl.* API
LANG: 'en-US',
// used by the Date API
TZ: 'UTC',
},
environment: 'jsdom',
setupFiles: resolve(__dirname, './tests/setup.js'),
globalSetup: resolve(__dirname, './tests/global-setup.js'),
exclude: [
'tests/component/**',
'node_modules/**',
'docs/**',
],
// @nextcloud/vue-select's ESM bundle imports its own CSS inline
// (`import './assets/*.css'` at the top of dist/index.mjs). Routing
// it through Vite's transform pipeline lets the CSS import be
// handled instead of reaching Node's native ESM loader.
server: {
deps: {
inline: ['@nextcloud/vue-select'],
},
},
},
})
}