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

fix: upgrade RTL version to avoid peer-deps mismatch #13738

Merged
merged 10 commits into from
Jan 28, 2025

Conversation

MatanBobi
Copy link
Contributor

Resolves #13721

This PR upgrades the installed version of RTL to resolve the peer deps issue.
It also installs DTL because RTL version 16 requires DTL to be installed.

@MatanBobi
Copy link
Contributor Author

MatanBobi commented Dec 27, 2024

I'm trying to understand the reason for the tests breaking here but I'm not sure it's related to my changes.
Test failures reproduce on main too and are unrelated to my change.

@MatanBobi MatanBobi changed the title chore: upgrade RTL version to avoid peer-deps mismatch fix: upgrade RTL version to avoid peer-deps mismatch Dec 29, 2024
@JoeBrar
Copy link

JoeBrar commented Jan 19, 2025

Hi, when will this PR get accepted and merged into main branch?

@rickhanlonii
Copy link
Member

The remaining test failure seems legit but I'm not sure how to fix.

@JoeBrar
Copy link

JoeBrar commented Jan 28, 2025

Looks like the failing tests needs to be updated according to the latest React version

@iamrajhans
Copy link
Contributor

hi @rickhanlonii, I think will need to use the react-testing-lib for the failing test cases just like here

import { render, screen } from '@testing-library/react';

describe('dynamic import', () => {
  it('renders without crashing', async () => {
    // Dynamically import the component
    const DynamicImport = (await import('./DynamicImport')).default;

    // Render the component
    render(<DynamicImport />);
    expect(screen.getByText('Hello World!')).toBeInTheDocument();
  });
});

Reference link - https://kentcdodds.com/blog/common-mistakes-with-react-testing-library#not-using-screen

@rickhanlonii
Copy link
Member

@iamrajhans no, these tests are not using RTL. The issue is that the webpack config for SVGs uses an old version of @svgr/webpack which inlines an old JSX transform, which is not supported in 19. Not sure how to fix that, so going to ignore the SVG tests, and the SVG support can be fixed in a follow up if needed.

@rickhanlonii rickhanlonii merged commit fde66a2 into facebook:main Jan 28, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error from using npx create-react-app
5 participants