Skip to content

Instantly share code, notes, and snippets.

@StephanBijzitter
Created February 8, 2018 15:19
Show Gist options
  • Save StephanBijzitter/036140f1b4c8174018bd45c65360077f to your computer and use it in GitHub Desktop.
Save StephanBijzitter/036140f1b4c8174018bd45c65360077f to your computer and use it in GitHub Desktop.
// Enable notifications everywhere except on Codeship and production
const notify = !/codeship|production/.test(process.env.NODE_ENV);
module.exports = {
notify,
automock: false,
resetModules: true,
collectCoverage: false,
coverageDirectory: '<rootDir>/coverage/jest',
collectCoverageFrom: [
'src/**/*.js',
'src/**/*.jsx',
'source/**/*.ts',
'source/**/*.tsx',
'!src/**/index.*',
'!src/**/*.spec.*',
'!src/**/*.snapshot.*',
'!source/**/index.*',
'!source/**/*.spec.*',
'!source/canvas/**/*'
],
testMatch: [
'<rootDir>/src/**/*.spec.js',
'<rootDir>/source/**/*.spec.ts',
'<rootDir>/src/**/*.snapshot.jsx',
'<rootDir>/source/**/*.snapshot.tsx'
],
moduleFileExtensions: [
'js',
'ts',
'jsx',
'tsx',
'json'
],
setupFiles: [
'<rootDir>/scripts/jest/setup.js'
],
moduleNameMapper: {
'business/(.*)$': '<rootDir>/src/business/$1',
'commonComponents/(.*)$': '<rootDir>/src/react/common/components/$1',
'constants/(.*)$': '<rootDir>/src/constants/$1',
'defaultComponents/(.*)$': '<rootDir>/src/react/default/components/$1',
'fabricImplementation/(.*)$': '<rootDir>/src/canvas/fabric/$1',
'Intent/(.*)$': '<rootDir>/source/Intent/$1',
'utils/(.*)$': '<rootDir>/src/utils/$1',
'\\.(scss|jpg|png)$': '<rootDir>/scripts/jest/mock.js'
},
modulePathIgnorePatterns: [
'/.git/',
'/.idea/',
'/.vagrant/',
'/build/',
'/documentation/',
'/scripts/'
],
transform: {
'^.+\\.(js|jsx)$': 'babel-jest',
'^.+\\.(ts|tsx)$': '<rootDir>/node_modules/ts-jest/preprocessor.js'
},
transformIgnorePatterns: [
'/node_modules/(?!@)/'
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment