File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -18,16 +18,15 @@ export default async function globalSetup() {
1818 process . env . COOKIE_SECRET = 'test-cookie-secret-for-jest' ; // Add cookie secret for tests
1919 process . env . DEPLOYSTACK_FRONTEND_URL = 'http://localhost:5174' ; // Add dummy frontend URL for tests
2020
21- // Clean up persistent data before tests
22- if ( await fs . pathExists ( TEST_DB_FILE_PATH ) ) {
23- await fs . remove ( TEST_DB_FILE_PATH ) ;
24- }
25- if ( await fs . pathExists ( TEST_DB_SELECTION_PATH ) ) {
26- await fs . remove ( TEST_DB_SELECTION_PATH ) ;
21+ // Clean up the entire persistent_data directory for tests
22+ if ( await fs . pathExists ( PERSISTENT_DATA_PATH ) ) {
23+ await fs . remove ( PERSISTENT_DATA_PATH ) ;
24+ console . log ( `[TEST_SETUP_DEBUG] Removed directory: ${ PERSISTENT_DATA_PATH } ` ) ;
2725 }
2826
29- // Ensure the database directory exists (it's shared, but files are separate)
27+ // Recreate the necessary directory structure
3028 await fs . ensureDir ( path . join ( PERSISTENT_DATA_PATH , 'database' ) ) ;
29+ console . log ( `[TEST_SETUP_DEBUG] Ensured directory exists: ${ path . join ( PERSISTENT_DATA_PATH , 'database' ) } ` ) ;
3130
3231 // IMPORTANT: We need to tell the application to USE this test database file.
3332 // The db/config.ts now uses 'db.selection.test.json' when NODE_ENV is 'test'.
You can’t perform that action at this time.
0 commit comments