jest.config.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. module.exports = {
  2. globals: {
  3. __DEV__: true
  4. },
  5. setupFilesAfterEnv: ['<rootDir>/test/jest/jest.setup.js'],
  6. // noStackTrace: true,
  7. // bail: true,
  8. // cache: false,
  9. // verbose: true,
  10. // watch: true,
  11. collectCoverage: true,
  12. coverageDirectory: '<rootDir>/test/jest/coverage',
  13. collectCoverageFrom: [
  14. '<rootDir>/bin/**/*.js',
  15. '<rootDir>/helpers/**/*.js'
  16. ],
  17. coverageReporters: ['json-summary', 'text', 'lcov'],
  18. coverageThreshold: {
  19. global: {
  20. // branches: 50,
  21. // functions: 50,
  22. // lines: 50,
  23. // statements: 50
  24. }
  25. },
  26. testMatch: [
  27. '<rootDir>/test/jest/__tests__/**/*.spec.js',
  28. '<rootDir>/test/jest/__tests__/**/*.test.js'
  29. ],
  30. moduleFileExtensions: ['js', 'json'],
  31. moduleNameMapper: {
  32. '^~/(.*)$': '<rootDir>/$1',
  33. '^bin/(.*)$': '<rootDir>/bin/$1',
  34. '^helpers/(.*)$': '<rootDir>/helpers/$1',
  35. '^templates/(.*)$': '<rootDir>/templates/$1',
  36. '^test/(.*)$': '<rootDir>/test/$1',
  37. '../../package.json': '<rootDir>/package.json'
  38. },
  39. transform: {}
  40. }