Skip to content

Commit

Permalink
Simplify expression: .window.document.defaultView -> .window (#13469)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdufresne authored Jan 4, 2023
1 parent da25cd0 commit aef5497
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/jest-environment-jsdom/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ export default class JSDOMEnvironment implements JestEnvironment<number> {
...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');
Expand Down

0 comments on commit aef5497

Please sign in to comment.