Skip to content

Commit 43f72ce

Browse files
authored
Chore: Upgrade jest-environment-jsdom, auth0.js, component-cdn-uploader and validator (#2693)
### 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 - Removed deprecated `jest-environment-jsdom-global` dependency - Using `jest-environment-jsdom@30.2.0` (already at target version) - Updated `validator` from `^13.6.0` to `^13.15.22` (security fix) - Keeping `auth0-js@9.29.0` (latest v9.x) - Keeping `@auth0/component-cdn-uploader@2.4.2` ### Test Infrastructure Changes - Created custom Jest environment to expose `jsdom` instance - Enhanced `setURL()` utility with dual-approach `window.location` mocking - Updated 2 snapshot files - Cleaned up unnecessary code in setup-tests.js ### Testing - No functional changes in production code. - All test suites continue to pass with the updated setup. - Minor snapshot changes due to rendering differences in updated jsdom and Jest versions. ### Checklist * [ ] I have read the [Auth0 general contribution guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md) * [ ] I have read the [Auth0 Code of Conduct](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md) * [ ] All code quality tools/guidelines have been run/followed * [ ] All relevant assets have been compiled
1 parent 5cae28e commit 43f72ce

File tree

7 files changed

+951
-671
lines changed

7 files changed

+951
-671
lines changed

customJsdomEnvironment.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const JSDOMEnvironment = require('jest-environment-jsdom').default;
2+
3+
module.exports = class CustomJsdomEnvironment extends JSDOMEnvironment {
4+
async setup() {
5+
await super.setup();
6+
// Expose jsdom instance globally so tests can call jsdom.reconfigure()
7+
this.global.jsdom = this.dom;
8+
}
9+
};

0 commit comments

Comments
 (0)