jest.config.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. module.exports = {
  2. preset: 'ts-jest',
  3. globals: {
  4. __DEV__: true,
  5. __TEST__: true,
  6. __VERSION__: require('./package.json').version,
  7. __BROWSER__: false,
  8. __BUNDLER__: true,
  9. __RUNTIME_COMPILE__: true,
  10. __GLOBAL__: false,
  11. __NODE_JS__: true,
  12. __FEATURE_OPTIONS__: true,
  13. __FEATURE_SUSPENSE__: true
  14. },
  15. coverageDirectory: 'coverage',
  16. coverageReporters: ['html', 'lcov', 'text'],
  17. collectCoverageFrom: [
  18. 'packages/*/src/**/*.ts',
  19. '!packages/runtime-test/src/utils/**',
  20. '!packages/template-explorer/**',
  21. '!packages/size-check/**'
  22. ],
  23. watchPathIgnorePatterns: ['/node_modules/', '/dist/', '/.git/'],
  24. moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
  25. moduleNameMapper: {
  26. '^@vue/(.*?)$': '<rootDir>/packages/$1/src',
  27. vue: '<rootDir>/packages/vue/src'
  28. },
  29. rootDir: __dirname,
  30. testMatch: ['<rootDir>/packages/**/__tests__/**/*spec.[jt]s?(x)'],
  31. testPathIgnorePatterns: process.env.SKIP_E2E
  32. ? // ignore example tests on netlify builds since they don't contribute
  33. // to coverage and can cause netlify builds to fail
  34. ['/node_modules/', '/examples/__tests__']
  35. : ['/node_modules/']
  36. }