/** @type {import('jest').Config} */
module.exports = {
    preset: 'ts-jest',
    testEnvironment: 'node',
    roots: ['<rootDir>/tests'],
    testMatch: ['**/*.test.ts'],
    moduleFileExtensions: ['ts', 'js', 'json'],
    moduleNameMapper: {
        '^cc$': '<rootDir>/tests/__mocks__/cc.ts',
        '^@/(.*)$': '<rootDir>/assets/scripts/$1',
        '^@common/(.*)$': '<rootDir>/assets/scripts/common/$1',
        '^@data/(.*)$': '<rootDir>/assets/scripts/data/$1',
        '^@logic/(.*)$': '<rootDir>/assets/scripts/logic/$1',
        '^@ui/(.*)$': '<rootDir>/assets/scripts/ui/$1',
    },
    collectCoverageFrom: [
        'assets/scripts/common/**/*.ts',
        'assets/scripts/data/**/*.ts',
        'assets/scripts/logic/**/*.ts',
        '!assets/scripts/**/*.d.ts',
    ],
    coverageThreshold: {
        global: {
            statements: 80,
            branches: 75,
            functions: 80,
            lines: 80,
        },
    },
    coverageReporters: ['text', 'lcov', 'html'],
    verbose: true,
};
