import type { Config } from 'jest';
import { defaults } from 'jest-config';

export default {
    ...defaults,
    displayName: 'red-ui',
    preset: '../../jest.preset.js',
    setupFilesAfterEnv: ['jest-preset-angular/setup-jest.js', 'jest-extended/all'],
    coverageDirectory: '../../coverage/apps/angular-jest',
    transform: {
        '^.+\\.(ts|mjs|js|html)$': [
            'jest-preset-angular',
            {
                tsconfig: '../../tsconfig.spec.json',
                stringifyContentPathRegex: '\\.(html|svg)$',
            },
        ],
    },
    testEnvironment: 'jest-environment-jsdom',
    transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
    snapshotSerializers: [
        'jest-preset-angular/build/serializers/no-ng-attributes',
        'jest-preset-angular/build/serializers/ng-snapshot',
        'jest-preset-angular/build/serializers/html-comment',
    ],
} as Config;
