jest.config.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /*eslint-env node*/
  2. module.exports = {
  3. verbose: false,
  4. collectCoverageFrom: [
  5. 'tests/js/spec/**/*.{js,jsx}',
  6. 'src/sentry/static/sentry/app/**/*.{js,jsx,ts,tsx}',
  7. ],
  8. coverageReporters: ['html', 'lcov', 'cobertura'],
  9. coverageDirectory: '.artifacts/coverage/',
  10. snapshotSerializers: ['enzyme-to-json/serializer'],
  11. moduleNameMapper: {
  12. '^app-test/(.*)': '<rootDir>/tests/js/$1',
  13. '\\.(css|less|png)$': '<rootDir>/tests/js/helpers/importStyleMock.js',
  14. '\\.(svg)$': '<rootDir>/tests/js/helpers/svgMock.js',
  15. 'integration-docs-platforms':
  16. '<rootDir>/tests/fixtures/integration-docs/_platforms.json',
  17. },
  18. modulePaths: ['<rootDir>/src/sentry/static/sentry'],
  19. setupFiles: [
  20. '<rootDir>/tests/js/throw-on-react-error.js',
  21. '<rootDir>/tests/js/setup.js',
  22. 'jest-canvas-mock',
  23. ],
  24. setupFilesAfterEnv: ['<rootDir>/tests/js/setupFramework.js'],
  25. testMatch: ['<rootDir>/tests/js/**/?(*.)(spec|test).js?(x)'],
  26. testPathIgnorePatterns: ['<rootDir>/tests/sentry/lang/javascript/'],
  27. unmockedModulePathPatterns: [
  28. '<rootDir>/node_modules/react',
  29. '<rootDir>/node_modules/reflux',
  30. ],
  31. transform: {
  32. '^.+\\.jsx?$': 'babel-jest',
  33. '^.+\\.tsx?$': 'babel-jest',
  34. },
  35. moduleFileExtensions: ['js', 'ts', 'jsx', 'tsx'],
  36. globals: {},
  37. };