jest.config.js 1.0 KB

123456789101112131415161718192021222324252627282930313233
  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. __FEATURE_OPTIONS__: true,
  11. __FEATURE_SUSPENSE__: true
  12. },
  13. coverageDirectory: 'coverage',
  14. coverageReporters: ['html', 'lcov', 'text'],
  15. collectCoverageFrom: [
  16. 'packages/*/src/**/*.ts',
  17. '!packages/runtime-test/src/utils/**',
  18. '!packages/template-explorer/**',
  19. '!packages/size-check/**'
  20. ],
  21. watchPathIgnorePatterns: ['/node_modules/'],
  22. moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
  23. moduleNameMapper: {
  24. '^@vue/(.*?)$': '<rootDir>/packages/$1/src'
  25. },
  26. rootDir: __dirname,
  27. testMatch: ['<rootDir>/packages/**/__tests__/**/*spec.[jt]s?(x)'],
  28. testPathIgnorePatterns: process.env.SKIP_E2E
  29. ? // ignore example tests on netlify builds since they don't contribute
  30. // to coverage and can cause netlify builds to fail
  31. ['/node_modules/', '/examples/__tests__']
  32. : ['/node_modules/']
  33. }