diff --git a/backend/api/jest.config.ts b/backend/api/jest.config.ts index 7f9a4c35..d88064a3 100644 --- a/backend/api/jest.config.ts +++ b/backend/api/jest.config.ts @@ -26,4 +26,8 @@ module.exports = { collectCoverageFrom: ['src/**/*.{ts,tsx}', '!src/**/*.d.ts'], silent: true, + // Each ts-jest worker is a full TS-compiling process; the default (cpus - 1) can spawn enough + // of them in parallel to exhaust memory on high-core-count machines. + maxWorkers: '50%', + workerIdleMemoryLimit: '512MB', } diff --git a/backend/email/jest.config.ts b/backend/email/jest.config.ts index 45675fa9..014598a8 100644 --- a/backend/email/jest.config.ts +++ b/backend/email/jest.config.ts @@ -23,4 +23,8 @@ module.exports = { collectCoverageFrom: ['src/**/*.{ts,tsx}', '!src/**/*.d.ts'], silent: true, + // Each ts-jest worker is a full TS-compiling process; the default (cpus - 1) can spawn enough + // of them in parallel to exhaust memory on high-core-count machines. + maxWorkers: '50%', + workerIdleMemoryLimit: '512MB', } diff --git a/backend/shared/jest.config.ts b/backend/shared/jest.config.ts index efb9b955..d6cf0fa9 100644 --- a/backend/shared/jest.config.ts +++ b/backend/shared/jest.config.ts @@ -27,4 +27,8 @@ module.exports = { collectCoverageFrom: ['src/**/*.{ts,tsx}', '!src/**/*.d.ts'], silent: true, + // Each ts-jest worker is a full TS-compiling process; the default (cpus - 1) can spawn enough + // of them in parallel to exhaust memory on high-core-count machines. + maxWorkers: '50%', + workerIdleMemoryLimit: '512MB', } diff --git a/common/jest.config.ts b/common/jest.config.ts index 57028c6e..0ccd8ab7 100644 --- a/common/jest.config.ts +++ b/common/jest.config.ts @@ -12,4 +12,8 @@ module.exports = { testMatch: ['**/*.test.ts'], collectCoverageFrom: ['src/**/*.{ts,tsx}', '!src/**/*.d.ts'], silent: true, + // Each ts-jest worker is a full TS-compiling process; the default (cpus - 1) can spawn enough + // of them in parallel to exhaust memory on high-core-count machines. + maxWorkers: '50%', + workerIdleMemoryLimit: '512MB', } diff --git a/jest.config.ts b/jest.config.ts index b2fa03e0..311f3bba 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -21,4 +21,8 @@ module.exports = { '/web', ], silent: true, + // Each ts-jest worker is a full TS-compiling process; the default (cpus - 1) can spawn enough + // of them in parallel to exhaust memory on high-core-count machines. + maxWorkers: '50%', + workerIdleMemoryLimit: '512MB', } diff --git a/web/jest.config.js b/web/jest.config.js index 45675fa9..014598a8 100644 --- a/web/jest.config.js +++ b/web/jest.config.js @@ -23,4 +23,8 @@ module.exports = { collectCoverageFrom: ['src/**/*.{ts,tsx}', '!src/**/*.d.ts'], silent: true, + // Each ts-jest worker is a full TS-compiling process; the default (cpus - 1) can spawn enough + // of them in parallel to exhaust memory on high-core-count machines. + maxWorkers: '50%', + workerIdleMemoryLimit: '512MB', }