formies/jest.config.js
Mohamad.Elsena a3236ae9d5 Refactor environment configuration for PostgreSQL and enhance application structure
- Updated `.env` and `.env.test` files to include PostgreSQL connection settings and Redis configuration.
- Migrated database from SQLite to PostgreSQL, updating relevant queries and connection logic.
- Enhanced error handling and logging throughout the application.
- Added new test utilities for PostgreSQL integration and updated user model methods.
- Introduced new routes for user authentication and form management, ensuring compatibility with the new database structure.
- Created login and registration views in EJS for user interaction.
2025-05-28 16:16:33 +02:00

29 lines
1008 B
JavaScript

// jest.config.js
module.exports = {
testEnvironment: "node",
verbose: true,
coveragePathIgnorePatterns: [
"/node_modules/",
"/__tests__/setup/",
"/src/config/", // DB, Passport, Redis configs
"/config/", // Logger config
],
clearMocks: true,
coverageDirectory: "coverage",
collectCoverage: true,
collectCoverageFrom: [
"src/**/*.js",
"!server.js",
"!src/app.js", // If you create an app.js
"!src/config/database.js", // Usually not directly tested
"!src/config/passport.js", // Tested via auth integration tests
"!src/config/redis.js", // Tested via rate limiter integration tests
"!src/services/notification.js", // External, consider mocking if tested
],
setupFilesAfterEnv: ["./__tests__/setup/jest.setup.js"],
// Stop tests after first failure if desired for faster feedback during dev
// bail: 1,
// Force exit after tests are complete if you have open handles (use with caution)
// forceExit: true, // Usually indicates something isn't being torn down correctly
};