Skip to content

VoiceStudio is the open-source, fully-local ElevenLabs alternative — voice cloning, voice design, video dubbing, dictation, transcription & audiobook creation in 646 languages.

1.6 KB
Raw Blame
// Vite+ (`vp test` / `vp check`) config for the RENDERER unit tests only.
// The Electron dev/build pipeline lives in electron.vite.config.ts.
import { resolve } from 'node:path';
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

export default defineConfig({
  // `vp fmt` / `vp check` read Oxfmt settings from here, not from .oxfmtrc.json
  // (kept in sync with it for editor integrations).
  fmt: {
    printWidth: 100,
    singleQuote: true,
    ignorePatterns: ['out/**', 'dist/**', 'release/**', 'src/renderer/src/components/ui/**'],
  },
  plugins: [react()],
  define: {
    __APP_VERSION__: JSON.stringify('0.0.0-test'),
    __DISTRIBUTION_TARGET__: JSON.stringify('direct'),
    __WEB_DEPLOYMENT__: false,
  },
  resolve: {
    alias: {
      '@': resolve(import.meta.dirname, 'src/renderer/src'),
      '@shared': resolve(import.meta.dirname, 'src/shared'),
      '@vercel/oidc': resolve(import.meta.dirname, 'src/renderer/src/lib/vercel-oidc-browser.ts'),
    },
    dedupe: ['react', 'react-dom'],
  },
  optimizeDeps: { exclude: ['@scalar/api-reference-react'] },
  test: {
    environment: 'jsdom',
    globals: true,
    setupFiles: ['./src/renderer/src/test/setup.ts'],
    // Shared release runners (Intel macOS, Windows ARM) run the suite many times slower
    // than a laptop; a real hang still fails, a busy runner no longer does.
    testTimeout: process.env.CI ? 30_000 : 5_000,
    include: [
      'src/main/**/*.test.{ts,tsx}',
      'src/renderer/**/*.test.{ts,tsx}',
      'src/shared/repair-request.test.ts',
      'src/shared/download-failure.test.ts',
    ],
    css: false,
  },
});