module.exports = { preset: '@wordpress/jest-preset-default', rootDir: '../../', verbose: true, moduleDirectories: [ 'node_modules', '/src' ], restoreMocks: true, transform: { '^.+\\.jsx?$': 'babel-jest', }, moduleNameMapper: { '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '/tests/js/jest-file-mock.js', '^react$': '/node_modules/react', '^react-dom$': '/node_modules/react-dom', }, testPathIgnorePatterns: [ '/node_modules/', '/build/', '/.*/build/', '/vendor', '/tests', ], transformIgnorePatterns: [ 'node_modules/?!(simple-html-tokenizer|is-plain-obj|is-plain-object|memize)', ], testEnvironment: 'jsdom', setupFiles: [ require.resolve( '@wordpress/jest-preset-default/scripts/setup-globals.js' ), ], setupFilesAfterEnv: [ require.resolve( '@wordpress/jest-preset-default/scripts/setup-test-framework.js' ), '/tests/js/jest-setup.js', ], };