Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

jest test basic setup

Aashish-Upadhyay-10187c99df13d76
diff --git a/backend/jest.config.ts b/backend/jest.config.ts
index b7ca988db8..8a72ad84c0 100644
--- a/backend/jest.config.ts
+++ b/backend/jest.config.ts
@@ -5,5 +5,5 @@ export default {
modulePaths: ['<rootDir>/src'],
testMatch: ['<rootDir>/tests/**/*.test.ts'],
setupFiles: ['<rootDir>/test-resources/env-vars.js'],
- setupFilesAfterEnv: ['<rootDir>/setupTests.ts']
+ setupFilesAfterEnv: ['<rootDir>/tests/setupTests.ts']
};
diff --git a/backend/setupTests.ts b/backend/setupTests.ts
deleted file mode 100644
index c98a366f9d..0000000000
--- a/backend/setupTests.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { beforeAll, afterAll } from '@jest/globals';
-import { DatabaseService } from './src/services';
-
-beforeAll(async () => {
- const mongoURL = process.env.MONGO_URL!;
- await DatabaseService.initDatabase(mongoURL);
-});
-
-afterAll(async () => {
- await DatabaseService.closeDatabase();
-});
diff --git a/backend/tests/healthcheck.test.ts b/backend/tests/setupTests.ts
similarity index 100%
rename from backend/tests/healthcheck.test.ts
rename to backend/tests/setupTests.ts