Chore: Upgrade jest-environment-jsdom, auth0.js, component-cdn-uploader and validator#2693
Chore: Upgrade jest-environment-jsdom, auth0.js, component-cdn-uploader and validator#2693ankita10119 merged 3 commits intomasterfrom
Conversation
|
Claude finished @gyaneshgouraw-okta's task —— View job Review Progress
Overall Assessment✅ This PR successfully addresses the deprecation of Key FindingsSecurity Updates (Positive)
Testing Infrastructure (Mostly Good)
Concerns to Address
Recommendation: Address the inline comments regarding error handling, test coverage, and validation of major dependency upgrades before merging. |
| async setup() { | ||
| await super.setup(); | ||
| // Expose jsdom instance globally so tests can call jsdom.reconfigure() | ||
| this.global.jsdom = this.dom; |
There was a problem hiding this comment.
The property name this.dom is not guaranteed to be stable across jsdom versions. Consider adding error handling or version checking to ensure this property exists before exposing it globally.
| this.global.jsdom = this.dom; | |
| // Expose jsdom instance globally so tests can call jsdom.reconfigure() | |
| if (this.dom) { | |
| this.global.jsdom = this.dom; | |
| } |
| // Approach 2: Fallback - Mock location properties with Object.defineProperty | ||
| const parsedUrl = new URL(url); | ||
|
|
||
| delete window.location; |
There was a problem hiding this comment.
The delete window.location operation can fail in strict mode or certain JavaScript environments. Consider wrapping this in a try-catch block to handle potential errors gracefully.
Additionally, the fallback approach may not fully replicate jsdom's behavior for all location-dependent operations. Consider documenting which test scenarios work with each approach.
Changes
This PR completes the migration from the deprecated jest-environment-jsdom-global package to the
standard jest-environment-jsdom, fixing all test failures and resolving security vulnerabilities.
Package Updates
jest-environment-jsdom-globaldependencyjest-environment-jsdom@30.2.0(already at target version)validatorfrom^13.6.0to^13.15.22(security fix)auth0-js@9.29.0(latest v9.x)@auth0/component-cdn-uploader@2.4.2Test Infrastructure Changes
jsdominstancesetURL()utility with dual-approachwindow.locationmockingTesting
Checklist