From 86839ae44a34d675f3494623c3237cc8142870c7 Mon Sep 17 00:00:00 2001 From: Valentin <18735898+ValentinViennot@users.noreply.github.com> Date: Mon, 28 Oct 2024 22:01:50 +0100 Subject: [PATCH] grant access to original process tested projects might require access to the original process object. might fix both #5620 and #11165 . --- packages/jest-util/src/createProcessObject.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/jest-util/src/createProcessObject.ts b/packages/jest-util/src/createProcessObject.ts index 59d67c0000c0..7d6bdf1b4887 100644 --- a/packages/jest-util/src/createProcessObject.ts +++ b/packages/jest-util/src/createProcessObject.ts @@ -117,5 +117,11 @@ export default function createProcessObject(): typeof Process { }, }); + Object.defineProperty(newProcess, 'original', { + get() { + return process; + }, + }); + return newProcess; }