jest.config.js 780 B

12345678910111213141516171819202122232425262728
  1. const lernaJson = require('./lerna.json')
  2. module.exports = {
  3. preset: 'ts-jest',
  4. globals: {
  5. __DEV__: true,
  6. __TEST__: true,
  7. __VERSION__: lernaJson.version,
  8. __BROWSER__: false,
  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/template-explorer/**',
  18. '!packages/runtime-test/src/utils/**'
  19. ],
  20. watchPathIgnorePatterns: ['/node_modules/'],
  21. moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
  22. moduleNameMapper: {
  23. '^@vue/(.*?)$': '<rootDir>/packages/$1/src'
  24. },
  25. rootDir: __dirname,
  26. testMatch: ['<rootDir>/packages/**/__tests__/**/*spec.[jt]s?(x)']
  27. }