diff --git a/packages/jest-message-util/src/__tests__/messages.test.ts b/packages/jest-message-util/src/__tests__/messages.test.ts index 21d33c9d0a83..55087aeeba80 100644 --- a/packages/jest-message-util/src/__tests__/messages.test.ts +++ b/packages/jest-message-util/src/__tests__/messages.test.ts @@ -435,7 +435,7 @@ it('should return the error cause if there is one', () => { it('should return the inner errors of an AggregateError', () => { // TODO remove this if when the lowest supported Node version is 15.0.0 // See https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V15.md#v8-86---35415 - if (AggregateError) { + if (typeof AggregateError !== 'undefined') { const aggError = new AggregateError([ new Error('Err 1'), new Error('Err 2'),