jest.config.js 766 B

12345678910111213141516171819202122232425
  1. module.exports = {
  2. moduleFileExtensions: ['js', 'jsx', 'json', 'vue'],
  3. transform: {
  4. '^.+\\.vue$': 'vue-jest',
  5. '.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$':
  6. 'jest-transform-stub',
  7. '^.+\\.jsx?$': 'babel-jest'
  8. },
  9. moduleNameMapper: {
  10. '^@/(.*)$': '<rootDir>/src/$1'
  11. },
  12. snapshotSerializers: ['jest-serializer-vue'],
  13. testMatch: [
  14. '**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)'
  15. ],
  16. collectCoverageFrom: ['src/utils/**/*.{js,vue}', '!src/utils/auth.js', '!src/utils/request.js', 'src/components/**/*.{js,vue}'],
  17. coverageDirectory: '<rootDir>/tests/unit/coverage',
  18. // 'collectCoverage': true,
  19. 'coverageReporters': [
  20. 'lcov',
  21. 'text-summary'
  22. ],
  23. testURL: 'http://localhost/'
  24. }