You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.6 KiB

  1. module.exports = {
  2. preset: 'ts-jest',
  3. setupFilesAfterEnv: ['./scripts/setupJestEnv.ts'],
  4. globals: {
  5. __DEV__: true,
  6. __TEST__: true,
  7. __VERSION__: require('./package.json').version,
  8. __BROWSER__: false,
  9. __GLOBAL__: false,
  10. __ESM_BUNDLER__: true,
  11. __ESM_BROWSER__: false,
  12. __NODE_JS__: true,
  13. __FEATURE_OPTIONS_API__: true,
  14. __FEATURE_SUSPENSE__: true,
  15. __FEATURE_PROD_DEVTOOLS__: false
  16. },
  17. coverageDirectory: 'coverage',
  18. coverageReporters: ['html', 'lcov', 'text'],
  19. collectCoverageFrom: [
  20. 'packages/*/src/**/*.ts',
  21. '!packages/runtime-test/src/utils/**',
  22. '!packages/template-explorer/**',
  23. '!packages/size-check/**',
  24. '!packages/runtime-core/src/profiling.ts',
  25. '!packages/runtime-core/src/customFormatter.ts',
  26. // DOM transitions are tested via e2e so no coverage is collected
  27. '!packages/runtime-dom/src/components/Transition*',
  28. // only called in browsers
  29. '!packages/vue/src/devCheck.ts',
  30. // only used as a build entry
  31. '!packages/vue/src/runtime.ts'
  32. ],
  33. watchPathIgnorePatterns: ['/node_modules/', '/dist/', '/.git/'],
  34. moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
  35. moduleNameMapper: {
  36. '^@vue/(.*?)$': '<rootDir>/packages/$1/src',
  37. vue: '<rootDir>/packages/vue/src'
  38. },
  39. rootDir: __dirname,
  40. testMatch: ['<rootDir>/packages/**/__tests__/**/*spec.[jt]s?(x)'],
  41. testPathIgnorePatterns: process.env.SKIP_E2E
  42. ? // ignore example tests on netlify builds since they don't contribute
  43. // to coverage and can cause netlify builds to fail
  44. ['/node_modules/', '/examples/__tests__']
  45. : ['/node_modules/']
  46. }