File tree Expand file tree Collapse file tree 2 files changed +10
-15
lines changed
Expand file tree Collapse file tree 2 files changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ module.exports = {
3333 moduleNameMapper : {
3434 '^@/(.*)$' : '<rootDir>/src/$1' ,
3535 } ,
36- setupFilesAfterEnv : [ '<rootDir>/tests/setup.ts' ] ,
36+ setupFiles : [ '<rootDir>/tests/setup.ts' ] ,
3737 testTimeout : 10000 ,
3838 verbose : true ,
3939 forceExit : true ,
Original file line number Diff line number Diff line change 1- import { jest , beforeAll , afterEach } from '@jest/globals' ;
2-
3- jest . setTimeout ( 10000 ) ;
4-
5- beforeAll ( ( ) => {
6- process . env . NODE_ENV = 'test' ;
7- process . env . LOG_LEVEL = 'error' ;
8- process . env . JWT_SECRET = 'test-secret-key' ;
9- process . env . JWT_EXPIRES_IN = '7d' ;
10- } ) ;
11-
12- afterEach ( ( ) => {
13- jest . clearAllMocks ( ) ;
14- } ) ;
1+ // Set environment variables before any imports
2+ // This file runs via setupFiles (before test framework initialization)
3+ process . env . NODE_ENV = 'test' ;
4+ process . env . LOG_LEVEL = 'error' ;
5+ process . env . JWT_SECRET = 'test-secret-key' ;
6+ process . env . JWT_EXPIRES_IN = '7d' ;
7+ process . env . OPENAI_API_KEY = 'test-openai-key' ;
8+ process . env . REDIS_HOST = 'localhost' ;
9+ process . env . REDIS_PORT = '6379' ;
You can’t perform that action at this time.
0 commit comments