Skip to content

A modern, self-hosted backup solution for secure, encrypted backups across local and cloud storage.

test: resolves jest config issue that caused oom.

towfiqic0fa20021722
diff --git a/backend/jest.config.ts b/backend/jest.config.ts
index 8d3d64f..49d4906 100644
--- a/backend/jest.config.ts
+++ b/backend/jest.config.ts
@@ -6,8 +6,10 @@ const config: Config = {
verbose: true,
clearMocks: true,
- // Limit workers to prevent OOM and recycle workers that accumulate memory
- maxWorkers: '50%',
+ // Limit workers to prevent OOM and recycle workers that accumulate memory.
+ // A fixed cap (not a core-percentage) keeps concurrent ts-jest compilation
+ // from exhausting native/zone memory on high-core machines.
+ maxWorkers: 4,
workerIdleMemoryLimit: '512MB',
// Explicitly define the transform using ts-jest
@@ -23,6 +25,9 @@ const config: Config = {
moduleResolution: 'bundler',
esModuleInterop: true,
allowSyntheticDefaultImports: true,
+ // Transpile each file in isolation instead of building a
+ // whole-program type graph — the main source of worker OOM.
+ isolatedModules: true,
},
diagnostics: false,
},
diff --git a/backend/package.json b/backend/package.json
index 5ca3de2..c09ee2a 100644
--- a/backend/package.json
+++ b/backend/package.json
@@ -120,7 +120,7 @@
"lint": "eslint src/**/*.ts",
"migrate-db": "tsx -r dotenv/config src/db/migrate.ts",
"start": "node dist/index.js",
- "test": "cross-env NODE_OPTIONS='--max-old-space-size=8192' jest --config jest.config.ts",
+ "test": "jest --config jest.config.ts",
"build:pkg": "node ./scripts/build-pkg.js",
"clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true});require('fs').rmSync('public',{recursive:true,force:true})\"",
"copy:frontend": "node -e \"const fs=require('fs');const path=require('path');const src='../frontend/dist';if(!fs.existsSync(src)){console.log('Skipping copy:frontend - frontend dist not found');process.exit(0)};function copyDir(s,d){fs.mkdirSync(d,{recursive:true});fs.readdirSync(s,{withFileTypes:true}).forEach(e=>{const sp=path.join(s,e.name),dp=path.join(d,e.name);e.isDirectory()?copyDir(sp,dp):fs.copyFileSync(sp,dp)})};copyDir(src,'public')\"",