module.exports = { collectCoverageFrom: [ '/app/scripts/controllers/permissions/**/*.js', '/app/scripts/lib/createRPCMethodTrackingMiddleware.js', '/shared/**/*.js', '/ui/**/*.js', ], coverageDirectory: './jest-coverage/main', coveragePathIgnorePatterns: ['.stories.js', '.snap'], coverageReporters: ['html', 'text-summary', 'json-summary'], coverageThreshold: { global: { branches: 44, functions: 46.8, lines: 52, statements: 52, }, './app/scripts/controllers/permissions/**/*.js': { branches: 100, functions: 100, lines: 100, statements: 100, }, './app/scripts/lib/createRPCMethodTrackingMiddleware.js': { branches: 95.65, functions: 100, lines: 100, statements: 100, }, }, reporters: [ 'default', [ 'jest-junit', { outputDirectory: 'test/test-results/', outputName: 'junit.xml', }, ], ], // TODO: enable resetMocks // resetMocks: true, restoreMocks: true, setupFiles: ['/test/setup.js', '/test/env.js'], setupFilesAfterEnv: ['/test/jest/setup.js'], testMatch: [ '/ui/**/*.test.js', '/shared/**/*.test.js', '/app/scripts/lib/**/*.test.js', '/app/scripts/migrations/*.test.js', '/app/scripts/platforms/*.test.js', '/app/scripts/controllers/network/**/*.test.js', '/app/scripts/controllers/permissions/**/*.test.js', '/app/scripts/flask/**/*.test.js', '/app/scripts/lib/createRPCMethodTrackingMiddleware.test.js', '/app/scripts/constants/error-utils.test.js', ], testTimeout: 2500, // We have to specify the environment we are running in, which is jsdom. The // default is 'node'. This can be modified *per file* using a comment at the // head of the file. So it may be worthwhile to switch to 'node' in any // background tests. testEnvironment: 'jsdom', testEnvironmentOptions: { customExportConditions: ['node', 'node-addons'], }, workerIdleMemoryLimit: '500MB', };