Files
memohanzi/e2e/global-setup.ts
2025-11-21 09:51:16 +01:00

18 lines
523 B
TypeScript

import { execSync } from 'child_process'
async function globalSetup() {
console.log('Running database seed before E2E tests...')
try {
execSync('npx prisma db seed', {
stdio: 'inherit',
env: process.env,
})
console.log('Database seed completed successfully')
} catch (error) {
console.error('Warning: Database seed failed. Tests may fail if seed data is missing.')
console.error('Make sure Docker Compose is running and the database is accessible.')
}
}
export default globalSetup