Open History to see the last commit
1import { defineConfig } from 'vitest/config'
2import angular from '@analogjs/vite-plugin-angular'
3import packageJson from './package.json' with { type: 'json' }
4β
5export default defineConfig({
6 // fix from https://github.com/vitest-dev/vitest/issues/6992#issuecomment-2509408660
7 resolve: {
8 conditions: ['@tanstack/custom-condition'],
9 },
10 environments: {
11 ssr: {
12 resolve: {
13 conditions: ['@tanstack/custom-condition'],
14 },
15 },
16 },
17 esbuild: {
18 target: 'es2022',
19 },
20 plugins: [
21 angular({
22 tsconfig: './tsconfig.spec.json',
23 // Vitest sets VITEST; Analog defaults jit: true, which skips ngtsc transforms for
24 // signal inputs so inputBinding() fails (NG0315). jit: false needs compiler-cli on
25 // the same TypeScript 5.9 version as the plugin to avoid mixed compiler ASTs.
26 jit: false,
27 }),
28 ],
29 test: {
30 name: packageJson.name,
31 dir: './src',
32 watch: false,
33 environment: 'jsdom',
34 setupFiles: ['./test-setup.ts'],
35 coverage: {
36 enabled: !!process.env.CI,
37 provider: 'istanbul',
38 include: ['src/**/*'],
39 exclude: ['src/__tests__/**'],
40 },
41 include: ['**/*.{test,spec}.{ts,mts,cts,tsx,js,mjs,cjs,jsx}'],
42 // The focused Zone.js project opts this file back in. The default project
43 // must not load provideZoneChangeDetection without the Zone.js setup file.
44 exclude: [
45 '**/zoneful-integration.test.ts',
46 '**/*.zoneful.test.ts',
47 '**/*.tmp.test.ts',
48 ],
49 typecheck: {
50 enabled: true,
51 include: ['**/*.test-d.ts'],
52 exclude: ['**/*.tmp.test.ts'],
53 },
54 globals: true,
55 restoreMocks: true,
56 },
57})