Skip to content

[Node 24][V3] Update Dependencies (@W-21177051@)#3663

Merged
adamraya merged 10 commits intodevelopfrom
W-21177051-node-24-v3-update-dependencies
Feb 27, 2026
Merged

[Node 24][V3] Update Dependencies (@W-21177051@)#3663
adamraya merged 10 commits intodevelopfrom
W-21177051-node-24-v3-update-dependencies

Conversation

@adamraya
Copy link
Contributor

@adamraya adamraya commented Feb 12, 2026

Description

The PR upgrades outdated dependencies across packages to improve security and compatibility with Node 24:

  • Jest 26 → 29: Major version bump in all packagess, including jest-cli, jest-environment-jsdom, jest-environment-jsdom-global, jest-fetch-mock, and babel-jest. Resolved breaking changes including ESM module resolution in jsdom, fake timer spy behavior, hook registration timing in Jest Circus, and customExportConditions defaults.
  • Archiver 1.3.0 → ^7.0.1: Updated in pwa-kit-dev with API compatibility verified for bundle creation. The finalize() method now returns a Promise and addressed lint errors from floating promises.
  • Rimraf replaced with Node.js built-in fs.rm/fs.rmSync: Removed the rimraf dependency. Node's built-in fs.rm is stable since Node 14.14 and provides equivalent behavior with recursive and force options, works cross-platform.

Refactor one-click checkout tests for Jest 29 upgrade included:

  • one-click-contact-info.test.js: Replaced jest.resetModules() + dynamic imports with configurable top-level jest.fn() mocks overridden per test.
  • one-click-shipping-address.test.js: Eliminated nested describe/beforeAll blocks using jest.resetModules() + module caching workaround. Replaced with configurable top-level mocks and stable return value references.
  • one-click-shipping-options.test.js: Eliminated nested describe/beforeAll blocks. Replaced with configurable top-level mocks and stable return value references to prevent infinite re-render loops.
  • index.test.js: Un skipped the Can add address during checkout as a registered customer test by adapting it to handle one-click checkout's auto advance behavior.

No public APIs were changed. All tests pass on Node 18, 20, 22, and 24.

Types of Changes

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Documentation update
  • Breaking change (could cause existing functionality to not work as expected)
  • Other changes (non-breaking changes that does not fit any of the above)

Breaking changes include:

  • Removing a public function or component or prop
  • Adding a required argument to a function
  • Changing the data type of a function parameter or return value
  • Adding a new peer dependency to package.json

Changes

  • Upgraded jest, babel-jest, jest-cli from ^26.6.3 to ^29.7.0 across all packages
  • Upgraded jest-environment-jsdom to ^29.7.0 and jest-environment-jsdom-global to ^4.0.0
  • Upgraded jest-fetch-mock from ^2.1.2 to ^3.0.3
  • Upgraded archiver from 1.3.0 to ^7.0.1 in pwa-kit-dev
  • Replaced rimraf with Node.js built-in fs.rm/fs.rmSync in pwa-kit-dev and internal-lib-build
  • Set testEnvironmentOptions.customExportConditions: ['node', 'node-addons'] in Jest configs to fix ESM resolution for uuid and nanoid
  • Added performance.mark/performance.measure polyfills in Jest setup for jsdom environment
  • Fixed jest.useFakeTimers() spy behavior in island/index.test.js (explicit jest.spyOn for setTimeout/clearTimeout)
  • Removed invalid global.fetch.mockClear() call in _app-config/index.test.js
  • Refactored checkout one-click test files to use configurable top-level mocks instead of jest.resetModules() + dynamic imports
  • Un-skipped the Can add address during checkout as a registered customer integration test

How to Test-Drive This PR

  • Run npm test from the monorepo root to verify all packages pass
  • Run npm test in packages/template-retail-react-app to verify all 2369 tests pass (211 suites)
  • Run npm test in packages/pwa-kit-dev to verify bundle/clean script utilities work
  • Verify npm run build succeeds and produces a valid bundle (archiver upgrade)
  • Test on Node 18, 20, 22, and 24 to confirm cross-version compatibility

Checklists

General

  • Changes are covered by test cases
  • CHANGELOG.md updated with a short description of changes (not required for documentation updates)

Accessibility Compliance

You must check off all items in one of the follow two lists:

  • There are no changes to UI

or...

Localization

  • Changes do not include UI text updates in the Retail React App

@cc-prodsec
Copy link
Collaborator

cc-prodsec commented Feb 12, 2026

Snyk checks have failed. 1 issues have been found so far.

Status Scanner Critical High Medium Low Total (1)
Open Source Security 0 1 0 0 1 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@adamraya adamraya added the skip changelog Skip the "Changelog Check" GitHub Actions step even if the Changelog.md files are not updated label Feb 12, 2026
@adamraya adamraya marked this pull request as ready for review February 20, 2026 17:13
@adamraya adamraya requested review from a team as code owners February 20, 2026 17:13
jest.useFakeTimers()
// doNotFake 'performance' so that the polyfilled performance.mark/measure
// methods (from perf_hooks) remain available in the jsdom environment
jest.useFakeTimers({doNotFake: ['performance']})
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@bendvc bendvc left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks for keeping the project up-to-date 👍

@adamraya adamraya merged commit c53cce9 into develop Feb 27, 2026
42 checks passed
@adamraya adamraya deleted the W-21177051-node-24-v3-update-dependencies branch February 27, 2026 00:34
rasbhat pushed a commit that referenced this pull request Mar 5, 2026
* Bump dependencies versions

* Update lock files

* Fix npm registry

* Update jest breaking changes

* One click checkout tests with configurable mocks

* Solve merge conflicts

* Update package-lock.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip changelog Skip the "Changelog Check" GitHub Actions step even if the Changelog.md files are not updated

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants