-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvitest.config.js
More file actions
51 lines (50 loc) · 1.6 KB
/
Copy pathvitest.config.js
File metadata and controls
51 lines (50 loc) · 1.6 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
43
44
45
46
47
48
49
50
51
import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
import path from 'path';
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
//? tone is only ever loaded via dynamic import (lazy Tone.js) and is globally
//? mocked in the setup file, so it must be resolved through Vite's graph.
//? rolldown-vite's oxc-resolver caches fs access while walking node_modules,
//? which intermittently fails the bare `tone` specifier at transform time
//? (vite:import-analysis normalizeUrl). Point directly at the package entry
//? so resolution is deterministic and never traverses node_modules.
tone: path.resolve(__dirname, 'node_modules/tone/build/esm/index.js'),
},
// Ensure directory imports resolve to index.js for ES modules
extensions: ['.js', '.jsx', '.json'],
mainFields: ['module', 'main'],
},
test: {
globals: true,
environment: 'jsdom',
setupFiles: './src/test/setup.js',
env: {
VITE_GOOGLE_WEB_CLIENT_ID: '123456789-test.apps.googleusercontent.com',
VITE_SUPABASE_URL: 'https://test-project.supabase.co',
VITE_SUPABASE_ANON_KEY: 'test-anon-key',
},
css: true,
pool: 'forks',
poolOptions: {
forks: {
singleFork: true,
},
},
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
exclude: [
'node_modules/',
'src/test/',
'scripts/**',
'supabase/functions/**',
'**/*.test.js',
'**/*.test.jsx',
],
},
},
});