Skip to content

Conversation

@bosun-ai
Copy link

@bosun-ai bosun-ai bot commented Nov 23, 2025

Summary

  • Set up a standalone regression test suite to validate React upgrade work in a controlled environment. This PR is work in progress; no functional app changes are included yet.

Scope of changes

  • Added an isolated Jest + jsdom test workspace under regression-tests/ to exercise minimal React rendering and interactions without JSX/Babel.
  • Introduced MSW scaffolding to mock network calls and cross-fetch to enable fetch in Node.
  • Added npm script test:regression to run the suite.
  • Project config additions (.nvmrc, .yarnrc.yml) to standardize local environment; yarn.lock updated accordingly.

React upgrade context

  • Goal: upgrade react from ^16.8.4 to 17.0.2. This PR prepares the regression test harness to safely validate behavior during the upgrade.
  • Current working dependency set in the regression workspace uses React 16.14 to establish baseline tests before incrementally moving to 17.0.2.

Regression test suite setup

  • Regression test suite added and passing. You can run it via npm run test:regression.

Highlights:

  • Isolated test workspace regression-tests/ with Jest + jsdom + Testing Library + MSW.
  • Minimal React tests using React.createElement() to avoid JSX/Babel.
  • cross-fetch installed to support fetch and MSW in Node.
  • Jest-dom matcher registration fixed by requiring extend-expect.

Run:

  • npm run test:regression

Working dependency versions:

  • react: ^16.14.0
  • react-dom: ^16.14.0
  • jest: ^26.6.3
  • jest-environment-jsdom: ^26.6.2
  • @testing-library/react: ^12.1.5
  • @testing-library/jest-dom: ^5.16.5
  • msw: ^0.49.3
  • cross-fetch: ^4.1.0

Files touched:

  • regression-tests/jest.config.js
  • regression-tests/setupTests.js
  • regression-tests/handlers.js
  • regression-tests/server.js
  • regression-tests/simple.test.js
  • package.json (added test:regression script)
  • .nvmrc, .yarnrc.yml, yarn.lock

Notes:

  • Jest prints a validation warning about setupFilesAfterEnv under this config but tests pass. I explicitly require jest-dom in the test to guarantee matcher availability on Jest 26.
  • MSW server scaffolding is ready; add handlers in regression-tests/handlers.js as you expand tests.

Impact and risk

  • Low risk; changes are limited to test scaffolding and configuration. No runtime code paths are modified.

Follow-up work

  • Incrementally bump the regression workspace React and React DOM to 17.0.2, adjust tests as needed, and then roll changes into the main app dependencies.
  • Add representative components and network interactions to the regression suite to cover critical paths.
  • Evaluate removing explicit jest-dom registration after upgrading Jest.

Reviewer action items

  • Run npm install and npm run test:regression to verify the suite passes locally.
  • Confirm test workspace structure and config meet project expectations.
  • Provide feedback on additional scenarios to include in the regression suite.

Links

  • This is a test PR and should not be merged.

This pull request is created by bosun, a code maintenance automation platform. For more information, visit bosun.ai.

@bosun-ai bosun-ai bot changed the title chore: prepare environment for React 17 upgrade (WIP) test: add regression test suite scaffolding for React upgrade (WIP) Nov 23, 2025
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