/** * Jest configuration using projects feature to separate AI and non-AI tests * This allows different concurrency settings for each type */ const baseConfig = { testEnvironment: 'node', testTimeout: 600000, verbose: true, silent: false, setupFilesAfterEnv: ['/tests/e2e/setup/jest-setup.js'], globalSetup: '/tests/e2e/setup/global-setup.js', globalTeardown: '/tests/e2e/setup/global-teardown.js', transform: {}, transformIgnorePatterns: ['/node_modules/'], moduleNameMapper: { '^@/(.*)$': '/$1' }, moduleDirectories: ['node_modules', ''], reporters: [ 'default', 'jest-junit', [ 'jest-html-reporters', { publicPath: './test-results', filename: 'index.html', pageTitle: 'Task Master E2E Test Report', expand: true, openReport: false, hideIcon: false, includeFailureMsg: true, enableMergeData: true, dataMergeLevel: 1, inlineSource: false } ] ] }; export default { projects: [ { ...baseConfig, displayName: 'Non-AI E2E Tests', testMatch: [ '/tests/e2e/**/add-dependency.test.js', '/tests/e2e/**/remove-dependency.test.js', '/tests/e2e/**/validate-dependencies.test.js', '/tests/e2e/**/fix-dependencies.test.js', '/tests/e2e/**/add-subtask.test.js', '/tests/e2e/**/remove-subtask.test.js', '/tests/e2e/**/clear-subtasks.test.js', '/tests/e2e/**/set-status.test.js', '/tests/e2e/**/show.test.js', '/tests/e2e/**/list.test.js', '/tests/e2e/**/next.test.js', '/tests/e2e/**/tags.test.js', '/tests/e2e/**/add-tag.test.js', '/tests/e2e/**/delete-tag.test.js', '/tests/e2e/**/rename-tag.test.js', '/tests/e2e/**/copy-tag.test.js', '/tests/e2e/**/use-tag.test.js', '/tests/e2e/**/init.test.js', '/tests/e2e/**/models.test.js', '/tests/e2e/**/move.test.js', '/tests/e2e/**/remove-task.test.js', '/tests/e2e/**/sync-readme.test.js', '/tests/e2e/**/rules.test.js', '/tests/e2e/**/lang.test.js', '/tests/e2e/**/migrate.test.js' ], // Non-AI tests can run with more parallelism maxWorkers: 4, maxConcurrency: 5 }, { ...baseConfig, displayName: 'Light AI E2E Tests', testMatch: [ '/tests/e2e/**/add-task.test.js', '/tests/e2e/**/update-subtask.test.js', '/tests/e2e/**/complexity-report.test.js' ], // Light AI tests with moderate parallelism maxWorkers: 3, maxConcurrency: 3 }, { ...baseConfig, displayName: 'Heavy AI E2E Tests', testMatch: [ '/tests/e2e/**/update-task.test.js', '/tests/e2e/**/expand-task.test.js', '/tests/e2e/**/research.test.js', '/tests/e2e/**/research-save.test.js', '/tests/e2e/**/parse-prd.test.js', '/tests/e2e/**/generate.test.js', '/tests/e2e/**/analyze-complexity.test.js', '/tests/e2e/**/update.test.js' ], // Heavy AI tests run sequentially to avoid rate limits maxWorkers: 1, maxConcurrency: 1, // Even longer timeout for AI operations testTimeout: 900000 // 15 minutes } ], // Global settings coverageDirectory: '/coverage-e2e', collectCoverageFrom: [ 'src/**/*.js', '!src/**/*.test.js', '!src/**/__tests__/**' ] };