Files
pchelpmaster/tests/api/global-setup.ts
T
kamaskandClaude Opus 5.5 5d5b2af318 test(api): add temporary pocketbase harness for api tests
`pnpm test:api` starts an isolated PocketBase with project migrations and
hooks in a temp dir, provides SDK client helpers and cleans up after the run,
on failure and on SIGINT/SIGTERM. The superuser is generated per instance.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EvmtStx737hu8gXe15e55W
2026-10-26 17:40:36 +03:00

12 lines
417 B
TypeScript

import type { TestProject } from 'vitest/node';
import { startPocketBase } from '../support/pocketbase-server';
import '../support/clients';
export default async function setup(project: TestProject) {
const { url, dataDir, superuser, stop } = await startPocketBase();
project.provide('pbUrl', url);
project.provide('pbDataDir', dataDir);
project.provide('pbSuperuser', superuser);
return stop;
}