mirror of
https://github.com/formbricks/formbricks.git
synced 2026-01-05 13:20:03 -06:00
Co-authored-by: Piyush Gupta <piyushguptaa2z123@gmail.com> Co-authored-by: Piyush Gupta <56182734+gupta-piyush19@users.noreply.github.com> Co-authored-by: Victor Hugo dos Santos <115753265+victorvhs017@users.noreply.github.com> Co-authored-by: pandeymangg <anshuman.pandey9999@gmail.com> Co-authored-by: Matti Nannt <matti@formbricks.com> Co-authored-by: Matti Nannt <mail@matthiasnannt.com> Co-authored-by: Johannes <johannes@formbricks.com> Co-authored-by: Johannes <72809645+jobenjada@users.noreply.github.com>
102 lines
4.1 KiB
TypeScript
102 lines
4.1 KiB
TypeScript
// vitest.config.ts
|
|
import react from "@vitejs/plugin-react";
|
|
import { PluginOption, loadEnv } from "vite";
|
|
import tsconfigPaths from "vite-tsconfig-paths";
|
|
import { defineConfig } from "vitest/config";
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
environment: "node",
|
|
environmentMatchGlobs: [["**/*.test.tsx", "jsdom"]],
|
|
exclude: ["playwright/**", "node_modules/**"],
|
|
setupFiles: ["./vitestSetup.ts"],
|
|
env: loadEnv("", process.cwd(), ""),
|
|
coverage: {
|
|
provider: "v8", // Use V8 as the coverage provider
|
|
reporter: ["text", "html", "lcov"], // Generate text summary and HTML reports
|
|
reportsDirectory: "./coverage", // Output coverage reports to the coverage/ directory
|
|
include: ["app/**/*.ts", "modules/**/*.ts", "lib/**/*.ts", "lingodotdev/**/*.ts"],
|
|
exclude: [
|
|
// Build and configuration files
|
|
"**/.next/**", // Next.js build output
|
|
"**/*.config.{js,ts,mjs,mts,cjs}", // All configuration files
|
|
"**/Dockerfile", // Dockerfiles
|
|
"**/vitestSetup.ts", // Vitest setup files
|
|
"**/*.setup.*", // Setup files
|
|
|
|
// Test and mock related files
|
|
"**/*.spec.*", // Test files
|
|
"**/*.test.*", // Test files
|
|
"**/*.mock.*", // Mock files
|
|
"**/mocks/**", // Mock directories
|
|
"**/__mocks__/**", // Jest-style mock directories
|
|
"**/playwright/**", // Playwright E2E test files
|
|
|
|
// TSX files (covered by E2E tests)
|
|
"**/*.tsx", // All TSX/React component files
|
|
|
|
// Next.js specific files
|
|
"**/route.{ts,tsx}", // Next.js API routes
|
|
"**/middleware.ts", // Next.js middleware
|
|
"**/instrumentation.ts", // Next.js instrumentation files
|
|
"**/instrumentation-node.ts", // Next.js Node.js instrumentation files
|
|
|
|
// Documentation and static files
|
|
"**/openapi.ts", // OpenAPI spec files
|
|
"**/openapi-document.ts", // OpenAPI-related document files
|
|
"**/*.json", // JSON files
|
|
"**/*.mdx", // MDX files
|
|
"**/*.css", // CSS files
|
|
|
|
// Type definitions and constants
|
|
"**/types/**", // Type definition folders
|
|
"**/types.ts", // Files named 'types.ts'
|
|
"**/constants.ts", // Constants files
|
|
|
|
// Server-side code
|
|
"**/actions.ts", // Server actions (plural)
|
|
"**/action.ts", // Server actions (singular)
|
|
"lib/env.ts", // Environment configuration
|
|
"lib/posthogServer.ts", // PostHog server integration
|
|
"**/cache.ts", // Cache files
|
|
"**/cache/**", // Cache directories
|
|
|
|
// UI Components and Templates
|
|
"**/stories.*", // Storybook files
|
|
"**/templates.ts", // Project-specific template files
|
|
"modules/ui/components/icons/*", // Icon components
|
|
"modules/ui/components/icons/**", // Icon components (nested)
|
|
|
|
// Feature-specific modules
|
|
"app/**/billing-confirmation/**", // Billing confirmation pages
|
|
"modules/ee/billing/**", // Enterprise billing features
|
|
"modules/ee/multi-language-surveys/**", // Multi-language survey features
|
|
"modules/email/**", // Email functionality
|
|
"modules/integrations/**", // Integration modules
|
|
"modules/setup/**/intro/**", // Setup intro pages
|
|
"modules/setup/**/signup/**", // Setup signup pages
|
|
"modules/setup/**/layout.tsx", // Setup layouts
|
|
"modules/ee/contacts/components/**", // Contact components
|
|
|
|
// Third-party integrations
|
|
"lib/slack/**", // Slack integration
|
|
"lib/notion/**", // Notion integration
|
|
"lib/googleSheet/**", // Google Sheets integration
|
|
"app/api/google-sheet/**", // Google Sheets API
|
|
"app/api/billing/**", // Billing API
|
|
"lib/airtable/**", // Airtable integration
|
|
"app/api/v1/integrations/**", // Integration APIs
|
|
|
|
// Specific components
|
|
"modules/auth/lib/mock-data.ts", // Mock data for authentication
|
|
"packages/js-core/src/index.ts", // JS Core index file
|
|
|
|
// Other
|
|
"**/scripts/**", // Utility scripts
|
|
"**/*.mjs", // ES modules
|
|
],
|
|
},
|
|
},
|
|
plugins: [tsconfigPaths(), react() as PluginOption],
|
|
});
|