diff --git a/CHANGELOG.md b/CHANGELOG.md index 94f0c78a6c57..d1ef970e9e89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ - `[jest-config]` [**BREAKING**] Remove `enabledTestsMap` config, use `filter` instead ([#10787](https://github.com/facebook/jest/pull/10787)) - `[jest-resolve]` [**BREAKING**] Migrate to ESM ([#10688](https://github.com/facebook/jest/pull/10688)) - `[jest-repl, jest-runtime]` [**BREAKING**] Move the `jest-runtime` CLI into `jest-repl` ([#10016](https://github.com/facebook/jest/pull/10016)) +- `[jest-util]` No longer checking `enumerable` when adding `process.domain` ([#10862](https://github.com/facebook/jest/pull/10862)) ### Performance diff --git a/packages/jest-util/src/createProcessObject.ts b/packages/jest-util/src/createProcessObject.ts index 569977a339c1..83d8774ad070 100644 --- a/packages/jest-util/src/createProcessObject.ts +++ b/packages/jest-util/src/createProcessObject.ts @@ -112,17 +112,11 @@ export default function (): NodeJS.Process { newProcess.env = createProcessEnv(); newProcess.send = () => {}; - const domainPropertyDescriptor = Object.getOwnPropertyDescriptor( - newProcess, - 'domain', - ); - if (domainPropertyDescriptor && !domainPropertyDescriptor.enumerable) { - Object.defineProperty(newProcess, 'domain', { - get() { - return process.domain; - }, - }); - } + Object.defineProperty(newProcess, 'domain', { + get() { + return process.domain; + }, + }); return newProcess; }