-
-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathvitest.config.ts
More file actions
28 lines (26 loc) · 918 Bytes
/
Copy pathvitest.config.ts
File metadata and controls
28 lines (26 loc) · 918 Bytes
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
import { fileURLToPath } from 'node:url';
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
environment: 'jsdom',
setupFiles: ['./tests/unit/test-setup.ts'],
globals: true,
exclude: ['**/node_modules/**', '**/dist/**'],
include: ['tests/unit/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}']
},
resolve: {
alias: {
'@': '/src',
// Resolve package-internal imports as filesystem paths so
// directory-index imports (e.g. .../player/Slider) work in tests.
'starpod/src': fileURLToPath(
new URL('./packages/starpod/src', import.meta.url)
),
// Outside Astro there is no integration to provide the virtual config
// module, so tests resolve it straight to the site's config file.
'virtual:starpod/config': fileURLToPath(
new URL('./starpod.config.ts', import.meta.url)
)
}
}
});