Update E2E tests for new database folder.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import { execSync, spawn } from 'child_process'
|
import { execSync, spawn } from 'child_process'
|
||||||
import { join, dirname } from 'path'
|
import { join, dirname } from 'path'
|
||||||
import { existsSync, mkdirSync, writeFileSync } from 'fs'
|
import { existsSync, mkdirSync, rmSync, writeFileSync } from 'fs'
|
||||||
import { fileURLToPath } from 'url'
|
import { fileURLToPath } from 'url'
|
||||||
|
|
||||||
const __dirname = dirname(fileURLToPath(import.meta.url))
|
const __dirname = dirname(fileURLToPath(import.meta.url))
|
||||||
@@ -58,6 +58,11 @@ export default async function globalSetup() {
|
|||||||
// Use a fresh database file for tests
|
// Use a fresh database file for tests
|
||||||
const testDbFile = join(testDataDir, 'test.paskiadb')
|
const testDbFile = join(testDataDir, 'test.paskiadb')
|
||||||
|
|
||||||
|
if (existsSync(testDbFile)) {
|
||||||
|
console.log(' Removing stale test database...')
|
||||||
|
rmSync(testDbFile, { force: true, recursive: true })
|
||||||
|
}
|
||||||
|
|
||||||
// Start the server using Node's spawn
|
// Start the server using Node's spawn
|
||||||
const serverProcess = spawn('uv', serverArgs, {
|
const serverProcess = spawn('uv', serverArgs, {
|
||||||
cwd: projectRoot,
|
cwd: projectRoot,
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ export default async function globalTeardown() {
|
|||||||
const testDbFile = join(testDataDir, 'test.paskiadb')
|
const testDbFile = join(testDataDir, 'test.paskiadb')
|
||||||
if (existsSync(testDbFile)) {
|
if (existsSync(testDbFile)) {
|
||||||
console.log(' Removing test database...')
|
console.log(' Removing test database...')
|
||||||
rmSync(testDbFile)
|
rmSync(testDbFile, { force: true, recursive: true })
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate Python coverage report if coverage was collected
|
// Generate Python coverage report if coverage was collected
|
||||||
|
|||||||
Reference in New Issue
Block a user