-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.js
More file actions
27 lines (23 loc) · 1 KB
/
setup.js
File metadata and controls
27 lines (23 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/**
* Jest test setup file.
* Runs before all tests to configure the test environment.
*/
import { jest } from '@jest/globals';
// Make jest available globally
global.jest = jest;
global.expect = (await import('@jest/globals')).expect;
global.describe = (await import('@jest/globals')).describe;
global.it = (await import('@jest/globals')).it;
global.beforeEach = (await import('@jest/globals')).beforeEach;
// Set test environment variables
process.env.NODE_ENV = 'test';
process.env.JWT_SECRET = 'test-jwt-secret-32-characters-long';
process.env.JWT_REFRESH_SECRET = 'test-refresh-secret-32-characters-long';
process.env.ADMIN_PASSWORD = 'TestPassword123!';
process.env.ACTUAL_SERVER_URL = 'http://localhost:5006';
process.env.ACTUAL_PASSWORD = 'test';
process.env.ACTUAL_SYNC_ID = 'test-sync-id';
process.env.DATA_DIR = './tests/data';
process.env.SESSION_SECRET = 'test-session-secret-32-characters-long';
process.env.DB_TYPE = 'sqlite'; // Use SQLite for tests
process.env.DATABASE_URL = './tests/data/auth.db';