2022-02-20 10:45:55 +01:00
|
|
|
import { FullConfig } from '@playwright/test'
|
2022-10-06 08:33:46 +02:00
|
|
|
import { setupDatabase, teardownDatabase } from 'utils/playwright/databaseSetup'
|
2022-02-20 10:45:55 +01:00
|
|
|
|
|
|
|
async function globalSetup(config: FullConfig) {
|
|
|
|
const { baseURL } = config.projects[0].use
|
|
|
|
if (!baseURL) throw new Error('baseURL is missing')
|
|
|
|
await teardownDatabase()
|
|
|
|
await setupDatabase()
|
|
|
|
}
|
|
|
|
|
|
|
|
export default globalSetup
|