mirror of
https://github.com/johndoe6345789/docker-swarm-termina.git
synced 2026-04-24 13:45:01 +00:00
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
35 lines
794 B
JavaScript
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)
|