Skip to content

Jest

Create jest.config.ts in your project root:

import type { Config } from 'jest';
import baseConfig from '@presencelearning/frontend-config/jest';
export default {
...baseConfig,
// Customize module name mappings for your project
moduleNameMapper: {
...baseConfig.moduleNameMapper,
'@my-alias/(.*)': '<rootDir>/src/my-path/$1',
},
} satisfies Config;
  • jest-preset-angular configuration
  • MSW (Mock Service Worker) compatible
  • Coverage reporting to test-results/unit-coverage
  • ESM module transformation support
  1. Backup your jest.config.js
  2. Create new jest.config.ts importing the base config
  3. Copy custom moduleNameMapper entries
  4. Remove redundant settings (already in base config)

Update moduleNameMapper in your jest.config.ts to match your tsconfig.json paths.