jest.config.js 1.1 KB

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