workspace/devtools/configs/jest.config.base.js
rckrdmrd 789d1ab46b
Some checks failed
CI Pipeline / changes (push) Has been cancelled
CI Pipeline / core (push) Has been cancelled
CI Pipeline / trading-backend (push) Has been cancelled
CI Pipeline / trading-data-service (push) Has been cancelled
CI Pipeline / trading-frontend (push) Has been cancelled
CI Pipeline / erp-core (push) Has been cancelled
CI Pipeline / erp-mecanicas (push) Has been cancelled
CI Pipeline / gamilit-backend (push) Has been cancelled
CI Pipeline / gamilit-frontend (push) Has been cancelled
changes on workspace
2025-12-09 14:46:20 -06:00

89 lines
1.7 KiB
JavaScript

/**
* Jest Base Configuration
* Shared across all TypeScript projects
*
* Usage in project:
* ```js
* // jest.config.js
* const baseConfig = require('../../../devtools/configs/jest.config.base.js');
* module.exports = {
* ...baseConfig,
* roots: ['<rootDir>/src'],
* };
* ```
*/
module.exports = {
// TypeScript support
preset: 'ts-jest',
testEnvironment: 'node',
// Test patterns
testMatch: [
'**/__tests__/**/*.ts',
'**/*.spec.ts',
'**/*.test.ts',
],
// Module resolution
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
// Path aliases (override in project config)
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
'^@modules/(.*)$': '<rootDir>/src/modules/$1',
'^@shared/(.*)$': '<rootDir>/src/shared/$1',
'^@config/(.*)$': '<rootDir>/src/config/$1',
},
// Coverage
collectCoverageFrom: [
'src/**/*.ts',
'!src/**/*.d.ts',
'!src/**/*.spec.ts',
'!src/**/*.test.ts',
'!src/**/index.ts',
'!src/main.ts',
],
coverageDirectory: 'coverage',
coverageReporters: ['text', 'lcov', 'html'],
coverageThreshold: {
global: {
branches: 70,
functions: 70,
lines: 70,
statements: 70,
},
},
// Transform
transform: {
'^.+\\.tsx?$': ['ts-jest', {
tsconfig: 'tsconfig.json',
}],
},
// Setup
setupFilesAfterEnv: [],
// Timeouts
testTimeout: 10000,
// Clear mocks between tests
clearMocks: true,
restoreMocks: true,
// Verbose output
verbose: true,
// Ignore patterns
testPathIgnorePatterns: [
'/node_modules/',
'/dist/',
'/build/',
],
transformIgnorePatterns: [
'/node_modules/',
],
};