jest.config.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // For a detailed explanation regarding each configuration property, visit:
  2. // https://jestjs.io/docs/en/configuration.html
  3. const MODULE_NAME_MAPPING = {
  4. };
  5. module.exports = {
  6. preset: 'ts-jest/presets/js-with-ts',
  7. moduleNameMapper: MODULE_NAME_MAPPING,
  8. // Automatically clear mock calls and instances between every test
  9. clearMocks: true,
  10. // Indicates whether the coverage information should be collected while executing the test
  11. collectCoverage: true,
  12. // An array of glob patterns indicating a set of files for which coverage information should be collected
  13. // collectCoverageFrom: undefined,
  14. // The directory where Jest should output its coverage files
  15. coverageDirectory: 'coverage',
  16. // An array of regexp pattern strings used to skip coverage collection
  17. coveragePathIgnorePatterns: [
  18. '/node_modules/',
  19. ],
  20. // An object that configures minimum threshold enforcement for coverage results
  21. // TODO: activate -- 2020.03.24 Yuki Takei
  22. // coverageThreshold: {
  23. // global: {
  24. // branches: 70,
  25. // functions: 70,
  26. // lines: 70,
  27. // statements: 70,
  28. // },
  29. // },
  30. // An array of file extensions your modules use
  31. moduleFileExtensions: [
  32. 'js',
  33. 'json',
  34. 'jsx',
  35. 'ts',
  36. 'tsx',
  37. 'node',
  38. ],
  39. // The test environment that will be used for testing
  40. testEnvironment: 'node',
  41. // The glob patterns Jest uses to detect test files
  42. testMatch: [
  43. '**/src/**/__tests__/**/*.[jt]s?(x)',
  44. '**/src/**/?(*.)+(spec|test).[tj]s?(x)',
  45. ],
  46. };