erp-mecanicas-diesel-backen.../jest.config.js
Adrian Flores Cortes e38d3c3864 [MMD-D-006] feat: Add backend unit tests
Added Jest configuration and unit tests:
- jest.config.js: Jest configuration with ts-jest
- setup.ts: Global test setup with custom matchers

Test files (30 tests passing):
- service-order.service.test.ts: CRUD, status transitions, cost calculation
- diagnostic.service.test.ts: CRUD, OBD codes, completion workflow
- part.service.test.ts: CRUD, stock management, low stock alerts
- vehicle.service.test.ts: CRUD, VIN validation, odometer updates

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 05:03:12 -06:00

27 lines
659 B
JavaScript

/** @type {import('jest').Config} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
roots: ['<rootDir>/src'],
testMatch: ['**/__tests__/**/*.test.ts', '**/__tests__/**/*.spec.ts'],
transform: {
'^.+\\.tsx?$': ['ts-jest', {
tsconfig: 'tsconfig.json',
}],
},
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
},
collectCoverageFrom: [
'src/**/*.ts',
'!src/**/*.d.ts',
'!src/**/index.ts',
'!src/main.ts',
],
coverageDirectory: 'coverage',
coverageReporters: ['text', 'lcov', 'html'],
setupFilesAfterEnv: ['<rootDir>/src/__tests__/setup.ts'],
testTimeout: 10000,
verbose: true,
};