23 lines
1.0 KiB
TypeScript
23 lines
1.0 KiB
TypeScript
import { resolve, dirname } from 'path'
|
|
import { fileURLToPath } from 'url'
|
|
|
|
// `pikku db reset` only operates on files inside .pikku-runtime/, so the e2e db
|
|
// lives there (not e2e/.tmp).
|
|
const repoRoot = resolve(dirname(fileURLToPath(import.meta.url)), '../../..')
|
|
|
|
// Browser e2e config.
|
|
//
|
|
// The harness (browser-hooks.ts) starts both servers itself:
|
|
// - backend → backend/bin/start-e2e.ts (SQLite) on backendPort
|
|
// - frontend → apps/app vite dev server on 6001, configured to proxy /api to
|
|
// the backend (VITE_BACKEND_URL) and to treat its own origin as the API
|
|
// base (VITE_API_URL=<appUrl>/api) so auth + RPC stay same-origin.
|
|
export const browserConfig = {
|
|
appUrl: process.env.APP_URL || 'http://localhost:6001',
|
|
backendUrl: process.env.E2E_BACKEND_URL || 'http://localhost:6002',
|
|
/** Isolated SQLite file the e2e backend serves. */
|
|
dbFile: process.env.E2E_DB_FILE || resolve(repoRoot, '.pikku-runtime/browser-e2e.db'),
|
|
timeout: Number(process.env.E2E_TIMEOUT ?? 60_000),
|
|
headed: process.env.HEADED === '1',
|
|
}
|