import { startTestPocketbase } from '../support/pocketbase' import { E2E_POCKETBASE_PORT } from '../../frontend/playwright.config' /** * Starts one PocketBase instance, shared by the whole e2e run, on the fixed * port `playwright.config.ts` also bakes into the Nuxt server's env — so both * sides can reference it without needing an async hand-off between them. * * Playwright keeps this module's closure alive and calls the returned * function as teardown once all tests finish (no separate globalTeardown * file needed). */ export default async function globalSetup() { const pb = await startTestPocketbase({ port: E2E_POCKETBASE_PORT }) return async () => { await pb.stop() } }