Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

vitest.config.ts

32 lines808 Bytes

1import path from 'node:path'
2import { fileURLToPath } from 'node:url'
3import angular from '@analogjs/vite-plugin-angular'
4import { defineConfig } from 'vitest/config'
5import packageJson from './package.json' with { type: 'json' }
6​
7const packageDir = path.dirname(fileURLToPath(import.meta.url))
8​
9export default defineConfig({
10 esbuild: {
11 target: 'es2022',
12 },
13 plugins: [angular()],
14 resolve: {
15 alias: {
16 '@tanstack/query-devtools': path.join(
17 packageDir,
18 '../query-devtools/src/index.ts',
19 ),
20 },
21 },
22 test: {
23 name: packageJson.name,
24 dir: './src',
25 watch: false,
26 environment: 'jsdom',
27 setupFiles: ['test-setup.ts'],
28 coverage: { enabled: true, provider: 'istanbul', include: ['src/**/*'] },
29 globals: true,
30 restoreMocks: true,
31 },
32})