jest.config.js 491 B

123456789101112131415161718192021222324
  1. const path = require('path')
  2. module.exports = {
  3. rootDir: path.resolve(__dirname, '..'),
  4. collectCoverage: true,
  5. collectCoverageFrom: [
  6. 'src/**/*.{js,vue}'
  7. ],
  8. coverageDirectory: '<rootDir>/test/coverage',
  9. moduleFileExtensions: [
  10. 'js',
  11. 'vue'
  12. ],
  13. moduleNameMapper: {
  14. '^@/(.*)$': '<rootDir>/src/$1'
  15. },
  16. transform: {
  17. '^.+\\.js$': 'babel-jest',
  18. '^.+\\.vue$': 'vue-jest'
  19. },
  20. snapshotSerializers: [
  21. '<rootDir>/node_modules/jest-serializer-vue'
  22. ]
  23. }