import type { Config } from "@jest/types"; import swc from "./swc-config"; const jestConfig: Config.InitialOptions = { testEnvironment: "jsdom", rootDir: "../../", moduleNameMapper: { "@/hooks": ["/src/hooks"], "@/utils": ["/src/utils"], "@/constants": ["/src/constants"], "@/utils/([^\\.]*)$": ["/src/utils"], "@/pages/([^\\.]*)$": ["/src/pages/$1"], "@/hooks/([^\\.]*)$": ["/src/hooks/$1"], "@/mocks": ["/internal/testing/__mocks__"], "@/scss/([^\\.]*)$": ["/src/assets/scss/$1"], "@/constants/([^\\.]*)$": ["/src/constants/$1"], "@/images/([^\\.]*)$": ["/src/assets/images/$1"], "@/components/([^\\.]*)$": ["/src/components/$1"], ".+\\.(css|sass|scss)$": "identity-obj-proxy", ".+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "identity-obj-proxy", "^gatsby-core-utils/(.*)$": "gatsby-core-utils/dist/$1", "^gatsby-plugin-utils/(.*)$": [ "gatsby-plugin-utils/dist/$1", "gatsby-plugin-utils/$1", ], }, transform: { "^.+\\.[jt]sx?$": ["@swc/jest", swc] }, setupFiles: ["/internal/testing/jest-setup.ts"], testPathIgnorePatterns: ["node_modules", "\\.cache", ".*/public"], transformIgnorePatterns: ["node_modules/(?!(gatsby|gatsby-script)/)"], }; export default jestConfig;