// @flow
module.exports = {
  snapshotSerializers: ['enzyme-to-json/serializer'],
  testEnvironment: 'jsdom',
  setupFilesAfterEnv: ['<rootDir>/jest/setup-tests.js'],
  transform: {
    '^.+\\.mdx?$': '@storybook/addon-docs/jest-transform-mdx',
    '^.+\\.js$': '<rootDir>/jest/jest.transform.js',
  },
  coverageDirectory: 'coverage',
  collectCoverageFrom: [
    '**/src/**/*.js',
    '!**/src/**/*.story.js',
    '!**/src/**/*.stories.js',
    '!**/src/**/*.test.js',
    '!**/src/**/*.spec.js',
  ],
  coveragePathIgnorePatterns: [
    '/node_modules/',
    '/jest/',
    '/docs/',
    '/env/',
    '/utils/',
    '/flow/',
    '/templates/',
  ],
  moduleNameMapper: {
    '\\.css$': '<rootDir>/jest/non-js-module.mock.js',
    '\\.mk?d': '<rootDir>/jest/non-js-module.mock.js',
    '\\.eot\\?#iefix$': '<rootDir>/jest/non-js-module.mock.js',
    '\\.(eot|ttf|woff|woff2)$': '<rootDir>/jest/non-js-module.mock.js',
  },
  modulePathIgnorePatterns: ['<rootDir>/.yarn-cache/'],
  coverageReporters: ['lcov'],
  testMatch: ['<rootDir>/src/**/*.test.js'],
  globals: {
    DEFAULT_THEME_NAME: 'wealthsimple',
    STORYBOOK_TITLE: 'patchwork',
  },
};
