test: scaffold regression test suite for React 17 upgrade (WIP) #42
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Prepare upgrade path for React 17 by introducing a basic regression test suite scaffold and associated tooling. This PR is a work in progress and serves as a placeholder for the React 16.8.6 → 17.0.2 upgrade effort.
Changes
regression-tests/:jest.config.jswith jsdom environment and setup filesetupTests.jsconfiguring @testing-library, MSW server lifecycle, and a fetch polyfillserver.jsandhandlers.jsfor MSW request mockingsimple-component.test.jsexample rendering and click interaction test@testing-library/react@12.1.5@testing-library/jest-dom@4.2.4msw@0.25.0cross-fetch@^4.1.0(Node fetch polyfill for tests)test:regressionscript topackage.jsoninvoking Jest with the regression config.nvmrcspecifying Node 12 for consistent local/test environmentReasoning
.nvmrcto reduce environment-related test variance.Regression test suite setup
regression-tests/jest.config.jssetupTests.jsregression-tests/jest.config.jsregression-tests/setupTests.jsregression-tests/server.jsregression-tests/handlers.jsregression-tests/simple-component.test.jsTesting instructions
**/*.test.jsunderregression-tests/.Impact and risk
Follow-ups / open questions
.nvmrcas needed.Reviewer checklist
yarn run test:regressionexecutes successfully locally withnvm use.Links
This pull request is created by bosun, a code maintenance automation platform. For more information, visit bosun.ai.