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

[code-infra] Add react-testing-library eslint plugin #173

Open
3 tasks
oliviertassinari opened this issue Jul 12, 2024 · 0 comments
Open
3 tasks

[code-infra] Add react-testing-library eslint plugin #173

oliviertassinari opened this issue Jul 12, 2024 · 0 comments
Labels
scope: code-infra Specific to the core-infra product test

Comments

@oliviertassinari
Copy link
Member

oliviertassinari commented Jul 12, 2024

configure eslint-plugin-testing-library and fix issues

See mui/toolpad#3648 as an implementation example.

Could also be helpful in:

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

   test('renders content correctly', async () => {
-    const { getByText } = render(<AppProvider>Hello world</AppProvider>);
+    render(<AppProvider>Hello world</AppProvider>);

-    expect(getByText('Hello world')).toBeTruthy();
+    expect(screen.getByText('Hello world')).toBeTruthy();
   });
 });

For example mui/material-ui#41061 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: code-infra Specific to the core-infra product test
Projects
None yet
Development

No branches or pull requests

1 participant