Skip to content

Chore: Upgrade jest-environment-jsdom, auth0.js and component-cdn-uploader#2690

Closed
ankita10119 wants to merge 10 commits intomasterfrom
SDK-6434-1
Closed

Chore: Upgrade jest-environment-jsdom, auth0.js and component-cdn-uploader#2690
ankita10119 wants to merge 10 commits intomasterfrom
SDK-6434-1

Conversation

@ankita10119
Copy link
Contributor

@ankita10119 ankita10119 commented Oct 30, 2025

Changes

This pull request upgrades several dependencies and refactors the test setup to align with the latest version of Jest and jsdom. It removes the deprecated jest-environment-jsdom-global in favor of the built-in "jsdom" environment, updates browser utilities, and ensures that all tests continue to run reliably after the upgrade.

Dependency Upgrades

  • Removed jest-environment-jsdom-global and replaced it with the built-in "jsdom" test environment.
  • Upgraded jest-environment-jsdom from version ^29.3.1 to ^30.2.0.
  • Upgraded auth0-js from version ^9.27.0 to ^9.29.0.
  • Upgraded @auth0/component-cdn-uploader from version ^2.2.2 to ^2.4.0.

Test Infrastructure Changes

  • Replaced jest-environment-jsdom-global functionality by defining a global jsdom.reconfigure() mock within src/tests/setup-tests.js.
  • Added src/utils/browser.js to safely mock browser globals such as window.location, href, pathname, and search across tests.
  • Introduced src/test-setup/polyfills.js to provide polyfills for TextEncoder, MessagePort, and other web APIs required by jsdom.
  • Updated tests to use the new browser utility helpers and adjusted snapshots where necessary.

Code Updates

  • Updated logic in core/index.js, core/sso/last_login_screen.jsx, and core/web_api/p2_api.js to use the new browser utilities for accessing and mocking location data.
  • Replaced spread syntax with Object.assign for better legacy browser compatibility (IE 11).
  • Updated Babel and Webpack configurations to target IE 11 explicitly and ensure all transforms are applied.

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.

Reference

https://github.com/auth0/lock/security/dependabot/189

Checklist

@ankita10119 ankita10119 requested a review from a team as a code owner October 30, 2025 05:46
@ankita10119
Copy link
Contributor Author

@claude

@github-actions

This comment has been minimized.

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

ankita10119 and others added 2 commits October 30, 2025 20:07
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@gyaneshgouraw-okta
Copy link
Contributor

@claude

@github-actions

This comment has been minimized.

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

Copy link

@yogeshchoudhary147 yogeshchoudhary147 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work on this PR. This is a really important cleanup—getting rid of deprecated packages and strengthening the test setup is a big win. The new browser utility and the IE11 fixes look correct. LGTM!

@gyaneshgouraw-okta
Copy link
Contributor

@claude

@github-actions

This comment was marked as off-topic.

}
if (this.isUniversalLogin && ulpTelemetry) {
telemetry = {
...ulpTelemetry,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Object spread operator incompatible with IE11

The object spread syntax (...ulpTelemetry, ...ulpTelemetry.env) is not supported in IE11, even with Babel polyfills. While Babel will transpile this, the PR description mentions replacing spread syntax with Object.assign for IE11 compatibility.

For consistency with the stated goals, replace with Object.assign:

telemetry = Object.assign({}, ulpTelemetry, {
  env: Object.assign({}, ulpTelemetry.env, {
    'lock.js-ulp': getVersion(),
    'auth0.js-ulp': auth0.version.raw
  })
});

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ankita10119 please check this, if this is relevant

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed and updated

@ankita10119 ankita10119 marked this pull request as draft November 26, 2025 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants