module.exports = { // The root of your source code, typically /src // `` is a token Jest substitutes roots: ['/src'], // Jest transformations -- this adds support for TypeScript // using ts-jest transform: { '^.+\\.tsx?$': 'ts-jest', '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': 'jest-transform-stub', }, // Runs special logic, such as cleaning up components // when using React Testing Library and adds special // extended assertions to Jest setupFilesAfterEnv: ['@testing-library/jest-dom/extend-expect'], // Test spec file resolution pattern // Matches parent folder `__tests__` and filename // should contain `test` or `spec`. testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$', // Module file extensions for importing moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], moduleNameMapper: { '^.+\\.(css|scss)$': 'identity-obj-proxy', '^.+.(png|jpg|ttf|woff|woff2)$': 'jest-transform-stub', }, };