jest.config.js 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. module.exports = async () => {
  2. return {
  3. verbose: true,
  4. testTimeout: 20000,
  5. testSequencer: "<rootDir>/tests/utils/test_sequencer.js",
  6. projects: [
  7. {
  8. displayName: "unit",
  9. globalSetup: "<rootDir>/tests/unit/helpers/global-setup.js",
  10. moduleNameMapper: {
  11. logger: "<rootDir>/js/logger.js"
  12. },
  13. testMatch: ["**/tests/unit/**/*.[jt]s?(x)"],
  14. testPathIgnorePatterns: ["<rootDir>/tests/unit/mocks", "<rootDir>/tests/unit/helpers"]
  15. },
  16. {
  17. displayName: "electron",
  18. testMatch: ["**/tests/electron/**/*.[jt]s?(x)"],
  19. testPathIgnorePatterns: ["<rootDir>/tests/electron/helpers"]
  20. },
  21. {
  22. displayName: "e2e",
  23. setupFilesAfterEnv: ["<rootDir>/tests/e2e/helpers/mock-console.js"],
  24. testMatch: ["**/tests/e2e/**/*.[jt]s?(x)"],
  25. modulePaths: ["<rootDir>/js/"],
  26. testPathIgnorePatterns: ["<rootDir>/tests/e2e/helpers", "<rootDir>/tests/e2e/mocks"]
  27. }
  28. ],
  29. collectCoverageFrom: ["./clientonly/**/*.js", "./js/**/*.js", "./modules/default/**/*.js", "./serveronly/**/*.js"],
  30. coverageReporters: ["lcov", "text"],
  31. coverageProvider: "v8"
  32. };
  33. };