From 11b75c02eac10a61e806db2ff200f1094691edaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Wed, 28 Dec 2022 09:58:14 +0100 Subject: [PATCH] ci: Update Jest setup on the CI to avoid OOM errors (no-changelog) (#5042) --- jest.config.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/jest.config.js b/jest.config.js index ee19fa41c1..1b2fb2f48d 100644 --- a/jest.config.js +++ b/jest.config.js @@ -11,7 +11,7 @@ const tsJestOptions = { }; /** @type {import('jest').Config} */ -module.exports = { +const config = { verbose: true, testEnvironment: 'node', testRegex: '\\.(test|spec)\\.(js|ts)$', @@ -23,3 +23,10 @@ module.exports = { '^@/(.*)$': '/src/$1', }, }; + +if (process.env.CI === 'true') { + config.maxWorkers = 2; + config.workerIdleMemoryLimit = 2048; +} + +module.exports = config;