Skip to content

Commit

Permalink
refactor(jest-util): no longer detecting enumerable when add domain
Browse files Browse the repository at this point in the history
    Considering we dropped support for Node 8, this compromise can be removed.
  • Loading branch information
mapleeit committed Nov 24, 2020
1 parent ff2b65c commit 3787f9d
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions packages/jest-util/src/createProcessObject.ts
Expand Up @@ -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;
}

0 comments on commit 3787f9d

Please sign in to comment.