/** @type {import("jest").Config} */
module.exports = {
    testEnvironment: "jsdom",
    roots: ["<rootDir>/src"],
    testPathIgnorePatterns: [
        "<rootDir>/node_modules/",
        "<rootDir>/src/features/onboarding/__tests__/e2e/",
        "<rootDir>/src/__tests__/e2e/",
    ],
    testMatch: [
        "**/__tests__/**/*.(test|spec).[jt]s?(x)",
        "**/*.(test|spec).[jt]s?(x)",
    ],
    transform: {
        "^.+\\.(ts|tsx)$": "babel-jest",
    },
    moduleNameMapper: {
        "^@/(.*)$": "<rootDir>/src/$1",
        "\\.(css|less|scss|sass)$": "identity-obj-proxy",
    },
    setupFilesAfterEnv: ["<rootDir>/src/setupTests.ts"],
    collectCoverageFrom: [
        "src/**/*.{ts,tsx}",
        "!src/**/*.d.ts",
        "!src/main.tsx",
        "!src/setupTests.ts",
        "!src/**/__tests__/**",
    ],
}
