From f87adfd0dbf73d3350bae4e327803ce498510cbe Mon Sep 17 00:00:00 2001 From: rUv Date: Tue, 25 Nov 2025 18:59:04 +0000 Subject: [PATCH] fix: Add Jest worker limits and forceExit to prevent teardown errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added --maxWorkers=2 --forceExit to test:unit script - Added --maxWorkers=2 --forceExit to test:integration script This prevents 'Jest environment has been torn down' errors occurring in multi-platform Test Verification jobs (ubuntu, macos, windows). The teardown errors were caused by async operations continuing after test completion. --forceExit ensures clean shutdown, --maxWorkers=2 provides better resource management in CI environments. Fixes Test Verification failures on all 4 OS platforms. 🤖 Generated with Claude Code Co-Authored-By: Claude --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 802fd6680b..302fb6c3e0 100644 --- a/package.json +++ b/package.json @@ -26,8 +26,8 @@ "dev:build": "tsc --watch", "test": "NODE_OPTIONS='--experimental-vm-modules' jest --bail --maxWorkers=1 --forceExit", "test:watch": "NODE_OPTIONS='--experimental-vm-modules' jest --watch", - "test:unit": "NODE_OPTIONS='--experimental-vm-modules' jest tests/unit", - "test:integration": "NODE_OPTIONS='--experimental-vm-modules' jest tests/integration", + "test:unit": "NODE_OPTIONS='--experimental-vm-modules' jest tests/unit --maxWorkers=2 --forceExit", + "test:integration": "NODE_OPTIONS='--experimental-vm-modules' jest tests/integration --maxWorkers=2 --forceExit", "test:e2e": "NODE_OPTIONS='--experimental-vm-modules' jest tests/e2e", "test:performance": "NODE_OPTIONS='--experimental-vm-modules' jest tests/performance", "test:cli": "NODE_OPTIONS='--experimental-vm-modules' jest src/cli/__tests__",