formies/jest.config.js
Mohamad.Elsena 2927013a6d Update environment configuration, add API documentation, and implement user authentication system
- Updated `.env` and added `.env.test` for environment variables.
- Introduced API documentation in `API_DOCUMENTATION.md`.
- Added authentication setup guide in `AUTHENTICATION_SETUP.md`.
- Implemented user authentication with JWT and email verification.
- Created new routes for user management and form submissions.
- Added middleware for API key authentication and error handling.
- Set up Redis for rate limiting and notifications.
- Removed obsolete files and configurations related to the previous Rust implementation.
2025-05-28 11:18:35 +02:00

29 lines
1.4 KiB
JavaScript

// jest.config.js
module.exports = {
testEnvironment: "node",
verbose: true,
coveragePathIgnorePatterns: [
"/node_modules/",
"/__tests__/setup/", // Ignore setup files from coverage
"/src/config/", // Often configuration files don't need testing
"/config/", // logger config
],
// Automatically clear mock calls and instances between every test
clearMocks: true,
// A path to a module which exports an async function that is triggered once before all test suites
// globalSetup: './__tests__/setup/globalSetup.js', // Optional: If you need global setup
// A path to a module which exports an async function that is triggered once after all test suites
// globalTeardown: './__tests__/setup/globalTeardown.js', // Optional: If you need global teardown
// The directory where Jest should output its coverage files
coverageDirectory: "coverage",
// Indicates whether the coverage information should be collected while executing the test
collectCoverage: true,
// An array of glob patterns indicating a set of files for which coverage information should be collected
collectCoverageFrom: [
"src/**/*.js",
"!server.js", // Usually the main server start file is hard to unit test directly
"!src/app.js", // If you extract Express app setup to app.js for testability
],
setupFilesAfterEnv: ["./__tests__/setup/jest.setup.js"], // For things like extending expect
};