import { defineConfig } from '@playwright/test';

export default defineConfig({
  testDir: './tests',
  // Runner split: `.spec.ts` = Playwright (e2e), `.test.ts` = Vitest (unit).
  // Without this, Playwright's default glob also grabs `.test.ts` files (e.g. the
  // uploads Gate-4 authz vitest fixture) and crashes loading their `vitest` imports.
  testMatch: '**/*.spec.ts',
  use: {
    baseURL: 'http://127.0.0.1:4329',
  },
  webServer: {
    command: 'pnpm --filter @app/consumer exec astro preview --host 127.0.0.1 --port 4329',
    url: 'http://127.0.0.1:4329',
    reuseExistingServer: true,
    timeout: 120_000,
  },
});
