Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update version of react used in tests to same as production #1917

Merged
merged 2 commits into from
Dec 19, 2024

Conversation

ChristopherChudzicki
Copy link
Contributor

@ChristopherChudzicki ChristopherChudzicki commented Dec 18, 2024

What are the relevant tickets?

None

Related to #1916, which is failing artificially due to incorrect version of react.

Description (What does it do?)

This PR updates the version of React to ^19.

This is the version of react used in our JSDOM tests, not production. NextJS bundles react internally, and we're on NextJS 15. It already uses react 19. 1

How can this be tested?

CI should pass. (This change does not affect production.)

Footnotes

  1. Our version of NextJS actually uses a canary react 19, namely 19.0.0-rc-02c0e824-20241028, which you can see if you add a console.log(React) into the application somewhere. Projects like NextJS using canary react is expected by the react developers. See https://react.dev/blog/2023/05/03/react-canaries. We should update to a newer version of NextJS 15, which will use a non-canary react, but let's do that separately.

@ChristopherChudzicki ChristopherChudzicki added the Needs Review An open Pull Request that is ready for review label Dec 18, 2024
@ChristopherChudzicki ChristopherChudzicki marked this pull request as ready for review December 18, 2024 21:00
@@ -124,7 +124,7 @@ const expectLastProps = (
) => {
expect(fc).toHaveBeenLastCalledWith(
expect.objectContaining(partialProps),
expect.anything(),
expect.toBeOneOf([expect.anything(), undefined]),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Evidently how react calls functional components changed a little between react 18 -> 19.

It used to call them as func(props, something_i_didnt_understand), now it calls them as func(props, undefined). This is irrelevant and is is already what's happening in MIT Learn on RC/Prod.

Copy link
Contributor

@jonkafton jonkafton left a comment

Choose a reason for hiding this comment

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

👍

@ChristopherChudzicki ChristopherChudzicki merged commit e57d5b2 into main Dec 19, 2024
11 checks passed
This was referenced Dec 20, 2024
This was referenced Jan 2, 2025
@rhysyngsun rhysyngsun deleted the cc/update-react branch February 7, 2025 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review An open Pull Request that is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants