the-tip-top-backend/jest.config.js
soufiane 9330c68e5c fix: improve CI/CD quality checks and fix test/lint configuration
Backend fixes:
- Add eslint.config.js with proper ES6 module configuration
- Add jest.config.js to support ES modules
- Update package.json with @eslint/js dependency
- Configure npm test script with NODE_OPTIONS for ES modules
- Update Jenkinsfile to block deployments on failed lint/tests

This ensures:
1. ESLint works correctly with ES6 modules
2. Jest can run tests with ES6 imports
3. Deployments are blocked if quality checks fail

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-18 15:40:04 +01:00

38 lines
658 B
JavaScript

export default {
// Use Node's experimental ESM support
testEnvironment: 'node',
// Transform ES modules
transform: {},
// Extensions to consider
extensionsToTreatAsEsm: ['.js'],
// Module name mapper for ES modules
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
// Test match patterns
testMatch: [
'**/test/**/*.test.js',
'**/__tests__/**/*.js',
],
// Coverage configuration
collectCoverageFrom: [
'src/**/*.js',
'!src/**/*.test.js',
'!**/node_modules/**',
],
// Ignore patterns
testPathIgnorePatterns: [
'/node_modules/',
'/dist/',
],
// Verbose output
verbose: true,
};