-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Include TS and JSX files to testing-library lint #45533
Conversation
Open in CodeSandbox Web Editor | VS Code | VS Code Insiders |
Size Change: +59 B (0%) Total Size: 1.28 MB
ℹ️ View Unchanged
|
<FlexItem>Item</FlexItem> | ||
<FlexBlock>Item</FlexBlock> | ||
</Flex> | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really want to render twice here? We probably only want to do the second render, and ignore the one that used to be in beforeEach
.
There are many other tests like this. For Flex
, Scrollable
, Spacer
, Surface
, ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to because we intend to compare the snapshots of the two renders (see the toMatchStyleDiffSnapshot
call below). That applies to the rest of the tests, or at least most of them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, we could use asFragment()
, but theoretically, it would do the same thing, just with different mechanics.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect, thank you @tyxla! GitHub is blocking me from approving my "own" PR so you'll need to approve from your side 😄
✅ APPROVED
Lol, let's do this then ✅ 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 🙃
Follow-up to #45103 and also suggested by @Mamaduka in #45366 (comment).
What?
This PR enables testing library and jest-dom ESLint rules for all
.ts
,.tsx
and.jsx
files.Why?
We're aiming to help maintain following the best practices when writing tests with testing-library.
How?
We're enabling the testing library and jest-dom ESLint rules for all
.ts
,.tsx
and.jsx
files, including that change to the list of excluded native files.Testing Instructions
Verify all tests are green, and there are no new ESLint errors.