Files
trips/e2e/setup/global-setup.ts
Shaun Campbell 595b805722
All checks were successful
PR Checks / lint-test-and-docker-build (pull_request) Successful in 2m27s
trips) add playwright e2e flows and issue video upload guidance
2026-02-22 16:16:47 -05:00

21 lines
661 B
TypeScript

import type { FullConfig } from '@playwright/test';
import { spawnSync } from 'child_process';
import { resolve } from 'path';
import { config as dotenvConfig } from 'dotenv';
dotenvConfig({ path: resolve(process.cwd(), '.env.test'), override: true });
async function globalSetup(_config: FullConfig): Promise<void> {
console.log('[e2e] Seeding test database via Bun...');
const result = spawnSync('bun', ['run', 'e2e/setup/seed-db.ts'], {
env: { ...process.env },
stdio: 'inherit',
cwd: process.cwd()
});
if (result.status !== 0) {
throw new Error(`[e2e] DB seed script failed with exit code ${result.status}`);
}
}
export default globalSetup;