Skip to content

Commit 49c1665

Browse files
committed
wip
1 parent 7eb6a39 commit 49c1665

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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,

tests/setup.ts

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
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';

0 commit comments

Comments
 (0)