From 6c819c6d354f4bd92005f95367988fa14fb6edea Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Mon, 9 Nov 2026 16:39:30 +0100 Subject: [PATCH] chore: cap Jest workers and skip type-checking per worker MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Jest defaulted to one worker per core, each type-checking with ts-jest. On 32 cores that took about 33 GB and froze a development machine. With 25% of the cores and isolatedModules, the suite peaks at 3.7 GB instead of 8.7 GB at the same worker count, and runs 11 s instead of 16 s. CI keeps type-checking through yarn typecheck. 🤖 Generated with Claude Code --- jest.config.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jest.config.js b/jest.config.js index fbee38ee..16bb5d6e 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,8 +1,11 @@ const esModules = ['.*/es/', '.*@babel', '@mll-lab'].join('|'); module.exports = { + // Jest defaults to one worker per core, which exhausts memory on many-core machines + maxWorkers: '25%', transform: { - '^.+\\.tsx?$': 'ts-jest', + // CI type-checks with tsc, so skip it per test worker + '^.+\\.tsx?$': ['ts-jest', { isolatedModules: true }], [`(${esModules}).+\\.js$`]: 'babel-jest', }, transformIgnorePatterns: [`/node_modules/(?!${esModules})`],