jest.config.js 908 B

1234567891011121314151617181920212223242526
  1. module.exports = {
  2. bail: 0, // 有测试错误后就停止错误
  3. moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
  4. preset: 'ts-jest',
  5. transform: {
  6. "^.+\\.ts?$": "ts-jest"
  7. },
  8. testEnvironment: "node",
  9. rootDir: './',
  10. "moduleDirectories": [
  11. "node_modules",
  12. "src"
  13. ],
  14. moduleNameMapper: {
  15. "^@src/(.*)$": "<rootDir>/src/$1",
  16. "^@root/(.*)$": "<rootDir>/../$1",
  17. "^@classes/(.*)$": "<rootDir>/../base-lib/src/classes/$1",
  18. "^@util/(.*)$": "<rootDir>/../base-lib/src/util/$1",
  19. "^@core/(.*)$": "<rootDir>/../base-lib/src/core/$1",
  20. "^@core-guards/(.*)$": "<rootDir>/../base-lib/src/core-guards/$1",
  21. "^@core-models/(.*)$": "<rootDir>/../base-lib/src/core-models/$1",
  22. },
  23. transformIgnorePatterns: ['<rootDir>/node_modules/'],
  24. "testRegex": "\\.spec\\.ts",
  25. "verbose": true
  26. };