import type {Config} from '@jest/types';

const config: Config.InitialOptions = {
    globals: {
        'ts-jest': {
            tsconfig: 'tsconfig.test.json',
        },
    },
    extraGlobals: ["Math"],
    verbose: true,
    slowTestThreshold: 30000,
    projects: ['<rootDir>'],
    testEnvironment: "node",
    testMatch: ['**/?(*.)+(spec|test).[jt]s?(x)'],
    testPathIgnorePatterns: ['/(?:production_)?node_modules/', '.d.ts$', 'const.ts'],
    transform: {
        '^.+\\.[jt]sx?$': 'ts-jest'
    },
    reporters: [
        "default",
        [
            "jest-junit",
            {
                classNameTemplate: (vars: { classname: string; }) => vars.classname,
                titleTemplate: (vars: { title: string; }) => vars.title
            }
        ]
    ]
};

export default config;
