jest.config.js 971 B

12345678910111213141516171819202122232425
  1. module.exports = {
  2. verbose: true,
  3. // This option sets the URL for the jsdom environment. It is reflected in properties such as location.href
  4. // testURL: "http://localhost",
  5. rootDir: '../../../',
  6. roots: ['app/frontend/tests'],
  7. moduleDirectories: ['node_modules', 'app/frontend'],
  8. moduleNameMapper: {
  9. '^@/(.*)$': '<rootDir>/app/frontend/$1',
  10. '^@mobile/(.*)$': '<rootDir>/app/frontend/mobile/$1',
  11. '^@common/(.*)$': '<rootDir>/app/frontend/common/$1',
  12. '^@test/(.*)$': '<rootDir>/app/frontend/tests/$1',
  13. '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
  14. 'jest-transform-stub',
  15. },
  16. moduleFileExtensions: ['js', 'ts', 'json', 'vue'],
  17. preset: 'ts-jest',
  18. testMatch: ['**/?(*.)+(spec|test).+(ts|tsx)'],
  19. transform: {
  20. '^.+\\.(ts|tsx)$': 'ts-jest',
  21. '^.+\\.vue$': '@vue/vue3-jest',
  22. },
  23. testEnvironment: 'jsdom',
  24. // snapshotSerializers: ['<rootDir>/node_modules/jest-serializer-vue'],
  25. }