diff --git a/CHANGELOG.md b/CHANGELOG.md index de59fb365eec..772c0304c42e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - `[@jest/transform]` Update dependency package `pirates` to 4.0.4 ([#12136](https://github.com/facebook/jest/pull/12136)) - `[jest-environment-node]` Add `AbortSignal` ([#12157](https://github.com/facebook/jest/pull/12157)) +- `[jest-environment-node]` Add Missing node global `performance` ([#12002](https://github.com/facebook/jest/pull/12002)) ### Chore & Maintenance diff --git a/packages/jest-environment-node/src/index.ts b/packages/jest-environment-node/src/index.ts index 8fa53d5e0339..385821e810d4 100644 --- a/packages/jest-environment-node/src/index.ts +++ b/packages/jest-environment-node/src/index.ts @@ -78,6 +78,10 @@ class NodeEnvironment implements JestEnvironment { if (typeof EventTarget !== 'undefined') { global.EventTarget = EventTarget; } + // performance is global in Node >= 16 + if (typeof performance !== 'undefined') { + global.performance = performance; + } installCommonGlobals(global, config.globals); this.moduleMocker = new ModuleMocker(global);