jest.config.js 766 B

123456789101112131415161718192021222324
  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://127.0.0.1/'
  24. }