Skip to content

Conversation

@bleadof
Copy link

@bleadof bleadof commented Dec 2, 2025

Summary

This PR updates multiple dependencies to their latest major/minor versions and fixes the test suite to accommodate breaking changes, particularly from fetch-mock v12.

Dependency Updates

Core Dependencies

Package From To
@emotion/react ^11.11.3 ^11.14.0
@emotion/styled ^11.11.0 ^11.14.1
swagger-client 3.8.1 3.36.0

MUI

Package From To
@mui/icons-material ^5.15.10 ^5.18.0
@mui/material ^5.15.10 ^5.18.0
@mui/styles ^5.15.10 ^5.18.0

React Final Form

Package From To
final-form ^4.20.10 ^5.0.0
final-form-arrays ^3.1.0 ^4.0.0
react-final-form ^6.5.9 ^7.0.0
react-final-form-arrays ^3.1.4 ^4.0.0

Dev Dependencies

Package From To
fetch-mock 9.11.0 ^12.6.0
gh-pages 2.0.1 ^6.3.0
webpack 5.90.3 ^5.103.0
webpack-dev-server 5.0.2 ^5.2.2

Test Fixes for fetch-mock v12

The upgrade to fetch-mock v12 introduced several breaking changes that required test modifications:

1. Custom Jest Environment

Added tests/jest-environment.js to expose Node.js built-in fetch globals (Request, Response, ReadableStream, Headers) that fetch-mock v12 expects to be available.

2. API Changes

  • fetchMock.mock()fetchMock.route()
  • fetchMock.once()fetchMock.route(..., { repeat: 1 })
  • fetchMock.reset()fetchMock.removeRoutes().clearHistory()
  • fetchMock.called()fetchMock.callHistory.called()
  • fetchMock.calls()fetchMock.callHistory.calls()

3. Removed Deprecated Features

  • Removed fetchMock.config.overwriteRoutes = true (no longer needed)
  • Removed const { Response } = fetchMock.config (Response now comes from globals)

4. Route Management

  • Added explicit route names using the third parameter for better control
  • Updated mock initialization to use fetchMock.removeRoutes().clearHistory().mockGlobal()

@bleadof bleadof marked this pull request as ready for review December 3, 2025 14:38
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.

1 participant