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;Features
Section titled “Features”jest-preset-angularconfiguration- MSW (Mock Service Worker) compatible
- Coverage reporting to
test-results/unit-coverage - ESM module transformation support
Migration from existing Jest config
Section titled “Migration from existing Jest config”- Backup your
jest.config.js - Create new
jest.config.tsimporting the base config - Copy custom
moduleNameMapperentries - Remove redundant settings (already in base config)
Troubleshooting
Section titled “Troubleshooting”Jest can’t resolve path aliases
Section titled “Jest can’t resolve path aliases”Update moduleNameMapper in your jest.config.ts to match your tsconfig.json paths.