import { defineConfig } from "vitest/config";
import { playwright } from "@vitest/browser-playwright";
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";

export default defineConfig({
  plugins: [react(), tailwindcss()],
  test: {
    include: ["**/*.browser.test.tsx"],
    setupFiles: ["./tests/setup-browser.css"],
    browser: {
      enabled: true,
      provider: playwright(),
      // https://vitest.dev/config/browser/playwright
      instances: [{ browser: "chromium" }],
    },
    /**
     * Intentionally tiny timeout because components should render quick
     */
    testTimeout: 2_000,
  },
});
