Files
docker-swarm-termina/frontend/jest.config.js
Claude 6135fc5287 Fix test timeout issues in Docker build environment
Added Jest timeout configuration to prevent "Test timeout of 30000ms exceeded" errors in beforeEach hooks during Docker builds.

Changes:
- Increased testTimeout to 60000ms (60 seconds) to accommodate resource-constrained CI/Docker environments
- Limited maxWorkers to 2 in CI environments to prevent resource exhaustion
- Maintains 50% worker utilization in local development

This ensures tests complete successfully both locally and in the Docker build test stage.

https://claude.ai/code/session_01MmsxkzWBPcfXaxPCx2tsAc
2026-02-01 18:39:59 +00:00

35 lines
794 B
JavaScript

const nextJest = require('next/jest')
const createJestConfig = nextJest({
dir: './',
})
const customJestConfig = {
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
testEnvironment: 'jest-environment-jsdom',
testTimeout: 60000,
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/$1',
},
testMatch: [
'**/__tests__/**/*.[jt]s?(x)',
'**/?(*.)+(spec|test).[jt]s?(x)',
],
testPathIgnorePatterns: [
'<rootDir>/node_modules/',
'<rootDir>/.next/',
'<rootDir>/e2e/',
],
collectCoverageFrom: [
'lib/**/*.{js,jsx,ts,tsx}',
'components/**/*.{js,jsx,ts,tsx}',
'app/**/*.{js,jsx,ts,tsx}',
'!**/*.d.ts',
'!**/node_modules/**',
'!**/.next/**',
],
maxWorkers: process.env.CI ? 2 : '50%',
}
module.exports = createJestConfig(customJestConfig)