jest.config.js 738 B

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