28 lines
871 B
TypeScript
28 lines
871 B
TypeScript
import { defineConfig } from 'vitest/config';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
const r = (p: string) => fileURLToPath(new URL(p, import.meta.url));
|
|
|
|
// Unit tests target the pure layers (domain/state/api/auth). We resolve the
|
|
// project's `$` aliases here directly rather than pulling in the full SvelteKit
|
|
// Vite plugin — `$app/*` runtime imports are mocked per-test with vi.mock().
|
|
export default defineConfig({
|
|
test: {
|
|
environment: 'happy-dom',
|
|
globals: true,
|
|
include: ['tests/unit/**/*.test.ts']
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
$domain: r('./src/lib/domain'),
|
|
$state: r('./src/lib/state'),
|
|
$api: r('./src/lib/api'),
|
|
$auth: r('./src/lib/auth'),
|
|
$map: r('./src/lib/map'),
|
|
$ui: r('./src/lib/ui'),
|
|
$i18n: r('./src/lib/i18n'),
|
|
$features: r('./src/lib/features'),
|
|
'$app/navigation': r('./tests/stubs/app-navigation.ts')
|
|
}
|
|
}
|
|
});
|