jest.config.js 811 B

12345678910111213141516171819202122232425262728293031
  1. const ignoredModules = ['@coreui/icons', '@coreui/utils'].join('|')
  2. module.exports = {
  3. moduleFileExtensions: [
  4. 'js',
  5. 'jsx',
  6. 'json',
  7. 'vue'
  8. ],
  9. transform: {
  10. '^.+\\.vue$': 'vue-jest',
  11. '.+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub',
  12. '^.+\\.(js|jsx)?$': '<rootDir>/node_modules/babel-jest'
  13. },
  14. transformIgnorePatterns: [`<rootDir>/node_modules/(?!${ignoredModules})`],
  15. moduleNameMapper: {
  16. '^@/(.*)$': '<rootDir>/src/$1'
  17. },
  18. snapshotSerializers: [
  19. 'jest-serializer-vue'
  20. ],
  21. testMatch: ['<rootDir>/tests/unit/**/*.spec.js'],
  22. verbose: true,
  23. testURL: 'http://localhost/',
  24. collectCoverage: true,
  25. collectCoverageFrom: [
  26. 'src/**/*.{js,vue}',
  27. '!**/node_modules/**'
  28. ],
  29. coverageReporters: ['html', 'text-summary']
  30. }