1
0

jest.config.js 968 B

12345678910111213141516171819202122232425262728
  1. /** @type {import('jest').Config} */
  2. const config = {
  3. testEnvironment: 'jsdom',
  4. testPathIgnorePatterns: [
  5. '<rootDir>/node_modules/',
  6. '<rootDir>/vendor/',
  7. '<rootDir>/config/',
  8. '<rootDir>/log/',
  9. '<rootDir>/public/',
  10. '<rootDir>/tmp/',
  11. ],
  12. setupFilesAfterEnv: ['<rootDir>/app/javascript/mastodon/test_setup.js'],
  13. collectCoverageFrom: [
  14. 'app/javascript/mastodon/**/*.{js,jsx,ts,tsx}',
  15. '!app/javascript/mastodon/features/emoji/emoji_compressed.js',
  16. '!app/javascript/mastodon/service_worker/entry.js',
  17. '!app/javascript/mastodon/test_setup.js',
  18. ],
  19. // Those packages are ESM, so we need them to be processed by Babel
  20. transformIgnorePatterns: ['/node_modules/(?!(redent|strip-indent)/)'],
  21. coverageDirectory: '<rootDir>/coverage',
  22. moduleDirectories: ['node_modules', '<rootDir>/app/javascript'],
  23. moduleNameMapper: {
  24. '\\.svg\\?react$': '<rootDir>/app/javascript/__mocks__/svg.js',
  25. },
  26. };
  27. module.exports = config;