import type { Config } from '@jest/types'; const config: Config.InitialOptions = { roots: ['/src'], testEnvironment: 'jsdom', setupFilesAfterEnv: ['/src/jest.setup.ts'], transform: { '^.+\\.(t|j)sx?$': [ '@swc/jest', { sourceMaps: true, jsc: { transform: { react: { runtime: 'automatic', }, }, }, }, ], '\\.(svg)$': 'jest-transformer-svg', '\\.(png)$': 'jest-transform-stub', }, moduleNameMapper: { '^@/(.*)$': '/src/$1', '^@logto/app-insights/(.*)$': '/../app-insights/lib/$1', '^@logto/shared/(.*)$': '/../shared/lib/$1', '\\.module\\.(css|sass|scss)$': 'identity-obj-proxy', }, transformIgnorePatterns: ['node_modules/(?!(.*(nanoid|jose|ky|@logto|@silverhand))/)'], }; export default config;