From aef5497c6685e8dd514e3f9ce9c601d03ca3cae2 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Wed, 4 Jan 2023 03:39:55 -0800 Subject: [PATCH] Simplify expression: .window.document.defaultView -> .window (#13469) --- packages/jest-environment-jsdom/src/index.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/jest-environment-jsdom/src/index.ts b/packages/jest-environment-jsdom/src/index.ts index 5973678a40f8..f71f350becc8 100644 --- a/packages/jest-environment-jsdom/src/index.ts +++ b/packages/jest-environment-jsdom/src/index.ts @@ -66,8 +66,7 @@ export default class JSDOMEnvironment implements JestEnvironment { ...projectConfig.testEnvironmentOptions, }, ); - const global = (this.global = this.dom.window.document - .defaultView as unknown as Win); + const global = (this.global = this.dom.window as unknown as Win); if (global == null) { throw new Error('JSDOM did not return a Window object');