Files
evig/cms-api/tests/setup.ts
T
Your Name 148d91a1b7 Update Dockerfile and TypeScript definitions; enhance health check and user role management
- Added curl to Dockerfile for health check improvements.
- Modified npm install commands to build TypeScript and prune unnecessary packages.
- Updated health check command to use curl for better reliability.
- Adjusted TypeScript definitions for user-related functions to return more specific response types.
- Changed user role options from 'viewer' to 'user' in multiple places for consistency.
- Updated package.json dependencies, including downgrading jsonwebtoken types and switching bcrypt to bcryptjs for compatibility.
- Added new environment variables for email configuration in the env.template file.
- Cleaned up various files by removing unnecessary newlines and ensuring consistent formatting.
2025-12-16 16:11:35 +01:00

34 lines
631 B
TypeScript

// Test setup file
import dotenv from 'dotenv';
// Load test environment variables
dotenv.config({ path: '.env.test' });
// Set test environment
process.env.NODE_ENV = 'test';
process.env.JWT_SECRET = 'test-jwt-secret-for-testing-only';
// Mock external dependencies if needed
jest.mock('../src/utils/database', () => ({
pool: {
connect: jest.fn(),
query: jest.fn(),
end: jest.fn(),
},
executeQuery: jest.fn(),
executeQuerySingle: jest.fn(),
executeTransaction: jest.fn(),
}));
// Global test setup
beforeAll(async () => {
// Setup test database or mocks
});
afterAll(async () => {
// Cleanup
});