Skip to content

Commit

Permalink
no longer detecting enumerable when add domain (#10862)
Browse files Browse the repository at this point in the history
  • Loading branch information
mapleeit committed Nov 25, 2020
1 parent ff2b65c commit 890852b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -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

Expand Down
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 890852b

Please sign in to comment.